From dc616aac33ceba6bd4667fd21f6b348f9c7e1ced Mon Sep 17 00:00:00 2001 From: Emden Gansner Date: Sun, 9 Apr 2017 13:48:41 -0400 Subject: [PATCH] Reset flex start state if error occurs. Otherwise, the next call to the lexer will potentially start in a state other than INITIAL. --- lib/cgraph/scan.l | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/cgraph/scan.l b/lib/cgraph/scan.l index 90eb39536..37660455b 100644 --- a/lib/cgraph/scan.l +++ b/lib/cgraph/scan.l @@ -277,6 +277,7 @@ void yyerror(char *str) agxbputc (&xb, '\n'); agerr(AGERR, "%s", agxbuse(&xb)); agxbfree(&xb); + BEGIN(INITIAL); } /* must be here to see flex's macro defns */ void aglexeof() { unput(GRAPH_EOF_TOKEN); } -- 2.40.0