]> git.saurik.com Git - bison.git/blobdiff - data/glr.c
* data/glr.c (YYCHK1): Do not assume YYE is in range.
[bison.git] / data / glr.c
index 342e5b16dd58e896c7c85dbbf6a34e4e6ad6152e..37e05af7fa6975cccef60c07f994638e2641734e 100644 (file)
@@ -179,7 +179,7 @@ b4_pre_prologue[
 
 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
 ]m4_ifdef([b4_stype],
-[b4_syncline([b4_stype_line], [b4_filename])
+[b4_syncline([b4_stype_line], [b4_file_name])
 typedef union m4_bregexp(b4_stype, [^{], [YYSTYPE ])b4_stype YYSTYPE;
 /* Line __line__ of glr.c.  */
 b4_syncline([@oline@], [@ofile@])],
@@ -2024,7 +2024,7 @@ yyrecoverSyntaxError (yyGLRStack* yystack,
 #define YYCHK1(YYE)                                                         \
   do {                                                                      \
     switch (YYE) {                                                          \
-    default:                                                                \
+    case yyok:                                                              \
       break;                                                                \
     case yyabort:                                                           \
       goto yyabortlab;                                                      \
@@ -2032,6 +2032,8 @@ yyrecoverSyntaxError (yyGLRStack* yystack,
       goto yyacceptlab;                                                             \
     case yyerr:                                                                     \
       goto yyuser_error;                                                    \
+    default:                                                                \
+      goto yybuglab;                                                        \
     }                                                                       \
   } while (0)
 
@@ -2187,6 +2189,10 @@ b4_syncline([@oline@], [@ofile@])])dnl
   yyresult = 0;
   goto yyreturn;
 
+ yybuglab:
+  YYASSERT (yyfalse);
+  /* Fall through.  */
+
  yyabortlab:
   yyresult = 1;
   goto yyreturn;
@@ -2306,7 +2312,7 @@ b4_token_defines(b4_tokens)
 
 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
 m4_ifdef([b4_stype],
-[b4_syncline([b4_stype_line], [b4_filename])
+[b4_syncline([b4_stype_line], [b4_file_name])
 typedef union m4_bregexp(b4_stype, [^{], [YYSTYPE ])b4_stype YYSTYPE;
 /* Line __line__ of glr.c.  */
 b4_syncline([@oline@], [@ofile@])],