(compile_file): If yyparse returns an error, pop all
authorJim Wilson <wilson@gcc.gnu.org>
Mon, 24 Jan 1994 23:59:48 +0000 (15:59 -0800)
committerJim Wilson <wilson@gcc.gnu.org>
Mon, 24 Jan 1994 23:59:48 +0000 (15:59 -0800)
pending binding levels.

From-SVN: r6427

gcc/toplev.c

index 8f08ea9dad70b3ed1685138e55e41877c8d7e538..7a3ec93b4caaa3d31d5d1570d69e79a666a17307 100644 (file)
@@ -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.  */