From: Jim Wilson Date: Mon, 24 Jan 1994 23:59:48 +0000 (-0800) Subject: (compile_file): If yyparse returns an error, pop all X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=453dfc7887f0558aa1c79c91d412a4d35271dece;p=gcc.git (compile_file): If yyparse returns an error, pop all pending binding levels. From-SVN: r6427 --- diff --git a/gcc/toplev.c b/gcc/toplev.c index 8f08ea9dad7..7a3ec93b4ca 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1933,8 +1933,15 @@ compile_file (name) (calling rest_of_compilation for each function). */ if (yyparse () != 0) - if (errorcount == 0) - fprintf (stderr, "Errors detected in input file (your bison.simple is out of date)"); + { + if (errorcount == 0) + fprintf (stderr, "Errors detected in input file (your bison.simple is out of date)"); + + /* In case there were missing closebraces, + get us back to the global binding level. */ + while (! global_bindings_p ()) + poplevel (0, 0, 0); + } /* Compilation is now finished except for writing what's left of the symbol table output. */