Skip to content

Commit

Permalink
Disable writing to 'last','last2','last3','time','memory_allocated'
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJefferson committed Jan 23, 2019
1 parent cf468b1 commit 876de7c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion lib/init.g
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ Ignore := function ( arg ) end;
##
SetFilterObj := "2b defined";
infinity := "2b defined";
last:="2b defined";


#############################################################################
Expand Down
10 changes: 7 additions & 3 deletions src/gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1616,16 +1616,20 @@ static Int PostRestore (
StructInitInfo * module )
{
/* construct the `ViewObj' variable */
ViewObjGVar = GVarName( "ViewObj" );
ViewObjGVar = GVarName( "ViewObj" );

/* construct the last and time variables */
Last = GVarName( "last" );
Last2 = GVarName( "last2" );
Last3 = GVarName( "last3" );
Time = GVarName( "time" );
MemoryAllocated = GVarName( "memory_allocated" );
AssGVar_NoReadOnlyCheck(Time, INTOBJ_INT(0));
AssGVar_NoReadOnlyCheck(MemoryAllocated, INTOBJ_INT(0));

AssReadOnlyGVar(GVarName("last"), Fail);
AssReadOnlyGVar(GVarName("last2"), Fail);
AssReadOnlyGVar(GVarName("last3"), Fail);
AssReadOnlyGVar(Time, INTOBJ_INT(0));
AssReadOnlyGVar(MemoryAllocated, INTOBJ_INT(0));
QUITTINGGVar = GVarName( "QUITTING" );

/* return success */
Expand Down
1 change: 0 additions & 1 deletion src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,6 @@ static void GetChar(void)
{
/* skip '\'' */
Char c = GET_NEXT_CHAR();

/* handle escape equences */
if ( c == '\n' ) {
SyntaxError("Character literal must not include <newline>");
Expand Down

0 comments on commit 876de7c

Please sign in to comment.