Skip to content

Commit

Permalink
Merge pull request #709 from markuspf/fix-397
Browse files Browse the repository at this point in the history
Fix #397 (Segfault after quitting from a break loop)
  • Loading branch information
ChrisJefferson committed Apr 14, 2016
2 parents 2d7e7ae + cf6272a commit 7aec88c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -2726,20 +2726,20 @@ ExecStatus ReadEvalCommand ( Obj context, UInt *dualSemicolon )
SyntaxError( "; expected");
}

/* check for dual semicolon */
if ( *TLS(In) == ';' ) {
GetSymbol();
if (dualSemicolon) *dualSemicolon = 1;
}
else {
if (dualSemicolon) *dualSemicolon = 0;
}

/* end the interpreter */
if ( ! READ_ERROR() ) {
/* Note that GetSymbol below potentially calls into the interpreter
again, and if an error occurred the interpreter is not in the correct
state to execute ReadLine on an input stream, leading to crashes */
if (!READ_ERROR()) {
type = IntrEnd( 0UL );
}
else {

/* check for dual semicolon */
if ( *TLS(In) == ';' ) {
GetSymbol();
if (dualSemicolon) *dualSemicolon = 1;
} else {
if (dualSemicolon) *dualSemicolon = 0;
}
} else {
IntrEnd( 1UL );
type = STATUS_ERROR;
}
Expand Down

0 comments on commit 7aec88c

Please sign in to comment.