From 6690197a7afd3f80ae4bb97191f6ec003ccb7526 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sat, 5 Feb 2011 09:04:03 +0000 Subject: [PATCH] Improve error recovery: Do not create an invalid statement if the semicolon at the end of a goto statement is missing. [r28307] --- parser.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/parser.c b/parser.c index dc93e3c..c476ed7 100644 --- a/parser.c +++ b/parser.c @@ -9803,7 +9803,7 @@ static statement_t *parse_goto(void) else parse_error_expected("while parsing goto", T_IDENTIFIER, NULL); eat_until_anchor(); - goto end_error; + return create_invalid_statement(); } /* remember the goto's in a list for later checking */ @@ -9812,9 +9812,8 @@ static statement_t *parse_goto(void) expect(';', end_error); - return statement; end_error: - return create_invalid_statement(); + return statement; } /** -- 2.20.1