Improve error recovery: Do not create an invalid statement if the semicolon at the...
authorChristoph Mallon <christoph.mallon@gmx.de>
Sat, 5 Feb 2011 09:04:03 +0000 (09:04 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sat, 5 Feb 2011 09:04:03 +0000 (09:04 +0000)
[r28307]

parser.c

index dc93e3c..c476ed7 100644 (file)
--- 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;
 }
 
 /**