Skip to content

Commit

Permalink
Workaround crash in issue #2487 in GAP 4.9
Browse files Browse the repository at this point in the history
This imitates a change already in the master branch.
  • Loading branch information
fingolfin authored and alex-konovalov committed Jul 3, 2018
1 parent 3ff99ff commit c9f2b58
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,8 @@ void SyntaxError (
OpenOutput( "*errout*" );
assert(STATE(Output));

/* one more error */
STATE(NrError)++;
STATE(NrErrLine)++;

/* do not print a message if we found one already on the current line */
if ( STATE(NrErrLine) == 1 )
if ( STATE(NrErrLine) == 0 )

{
/* print the message and the filename, unless it is '*stdin*' */
Expand All @@ -70,6 +66,11 @@ void SyntaxError (
assert(STATE(Output));
CloseOutput();
assert(STATE(Output));

/* one more error */
STATE(NrError)++;
STATE(NrErrLine)++;

}

/****************************************************************************
Expand Down

0 comments on commit c9f2b58

Please sign in to comment.