]> git.saurik.com Git - bison.git/blobdiff - data/lalr1.cc
* TODO: Add request from Nelson H. F. Beebe to be able to install
[bison.git] / data / lalr1.cc
index abf459f4404fc1d67656baa165d3d56947004ba0..abcdcd5d604163278d29f19f5b5919ad55cfd556 100644 (file)
@@ -20,6 +20,11 @@ m4_divert(-1)
 # 02110-1301  USA
 
 m4_include(b4_pkgdatadir/[c++.m4])
+
+# The header is mandatory.
+b4_defines_if([],
+              [m4_fatal(b4_skeleton[: using %defines is mandatory])])
+
 # Backward compatibility.
 m4_define([b4_location_constructors])
 m4_include(b4_pkgdatadir/[location.cc])
@@ -833,14 +838,14 @@ b4_error_verbose_if([, int tok])[)
     YYUSE (yystate);
 #if YYERROR_VERBOSE
     int yyn = yypact_[yystate];
-    if (yypact_ninf_ < yyn && yyn < yylast_)
+    if (yypact_ninf_ < yyn && yyn <= yylast_)
       {
        /* Start YYX at -YYN if negative to avoid negative indexes in
           YYCHECK.  */
        int yyxbegin = yyn < 0 ? -yyn : 0;
 
        /* Stay within bounds of both yycheck and yytname.  */
-       int yychecklim = yylast_ - yyn;
+       int yychecklim = yylast_ - yyn + 1;
        int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
        int count = 0;
        for (int x = yyxbegin; x < yyxend; ++x)