diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1994-01-24 15:59:48 -0800 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1994-01-24 15:59:48 -0800 |
commit | 453dfc7887f0558aa1c79c91d412a4d35271dece (patch) | |
tree | 01031a02a825876bc941a41bb0b8fa2163ea892c /gcc | |
parent | ff942a982967fec95d6108ce2958306fdbdec959 (diff) | |
download | gcc-453dfc7887f0558aa1c79c91d412a4d35271dece.zip gcc-453dfc7887f0558aa1c79c91d412a4d35271dece.tar.gz gcc-453dfc7887f0558aa1c79c91d412a4d35271dece.tar.bz2 |
(compile_file): If yyparse returns an error, pop all
pending binding levels.
From-SVN: r6427
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/toplev.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index 8f08ea9..7a3ec93 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. */ |