help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exceeded limits of %dprec/%merge?


From: Joel E. Denny
Subject: Re: Exceeded limits of %dprec/%merge?
Date: Wed, 17 May 2006 12:41:00 -0400 (EDT)

On Wed, 17 May 2006, Derek M Jones wrote:

> > > Thanks for the report.  I'll install a patch for this tomorrow.
> 
> Thanks for the fix.
> 
> > ===================================================================
> > RCS file: /sources/bison/bison/data/glr.c,v
> 
> While you're in this file you might also like to edit yyreportTree
> to subtract 1 from the yyrule value that gets printed out.  It is
> off by one compared to the listing that appears in the .output file.

Yep, thanks.  The following patches all of the above.

Joel

2006-05-17  Joel E. Denny  <address@hidden>

        * data/glr.c (yyreportTree): Make room in yystates for the state
        preceding the RHS.  This fixes the segmentation fault reported by Derek
        M. Jones in
        <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
        (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
        to the user.  Reported for yyreportTree by Derek M. Jones later in the
        same thread.
        * THANKS: Add Derek M. Jones.
        Update my email address.
        Fix typo in Steve Murphy's name.

Index: THANKS
===================================================================
RCS file: /sources/bison/bison/THANKS,v
retrieving revision 1.66
diff -p -u -r1.66 THANKS
--- THANKS      14 May 2006 21:00:37 -0000      1.66
+++ THANKS      17 May 2006 16:13:24 -0000
@@ -21,6 +21,7 @@ Cris Bailiff              c.bailiff+biso
 Cris van Pelt             address@hidden
 Daniel Hagerty            address@hidden
 David J. MacKenzie        address@hidden
+Derek M. Jones           address@hidden
 Dick Streefland           address@hidden
 Enrico Scholz             address@hidden
 Evgeny Stambulchik        address@hidden
@@ -34,7 +35,7 @@ Jan Nieuwenhuizen         address@hidden
 Jesse Thilo               address@hidden
 Jim Kent                  address@hidden
 Jim Meyering              address@hidden
-Joel E. Denny             address@hidden
+Joel E. Denny             address@hidden
 Juan Manuel Guerrero      address@hidden
 Kees Zeelenberg           address@hidden
 Keith Browne              address@hidden
@@ -67,7 +68,7 @@ Raja R Harinath           address@hidden
 Richard Stallman          address@hidden
 Robert Anisko             address@hidden
 Shura                     address@hidden
-Steve Murhpy             address@hidden
+Steve Murphy             address@hidden
 Tim Josling               address@hidden
 Tim Van Holder            address@hidden
 Tom Lane                  address@hidden
Index: data/glr.c
===================================================================
RCS file: /sources/bison/bison/data/glr.c,v
retrieving revision 1.174
diff -p -u -r1.174 glr.c
--- data/glr.c  15 May 2006 06:13:53 -0000      1.174
+++ data/glr.c  17 May 2006 16:13:27 -0000
@@ -1741,7 +1741,7 @@ yyreportTree (yySemanticOption* yyx, int
   int yynrhs = yyrhsLength (yyx->yyrule);
   int yyi;
   yyGLRState* yys;
-  yyGLRState* yystates[YYMAXRHS];
+  yyGLRState* yystates[1 + YYMAXRHS];
   yyGLRState yyleftmost_state;
 
   for (yyi = yynrhs, yys = yyx->yystate; 0 < yyi; yyi -= 1, yys = yys->yypred)
@@ -1757,11 +1757,11 @@ yyreportTree (yySemanticOption* yyx, int
   if (yyx->yystate->yyposn < yys->yyposn + 1)
     YYFPRINTF (stderr, "%*s%s -> <Rule %d, empty>\n",
               yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
-              yyx->yyrule);
+              yyx->yyrule - 1);
   else
     YYFPRINTF (stderr, "%*s%s -> <Rule %d, tokens %lu .. %lu>\n",
               yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
-              yyx->yyrule, (unsigned long int) (yys->yyposn + 1),
+              yyx->yyrule - 1, (unsigned long int) (yys->yyposn + 1),
               (unsigned long int) yyx->yystate->yyposn);
   for (yyi = 1; yyi <= yynrhs; yyi += 1)
     {
@@ -2578,7 +2578,7 @@ yypdumpstack (yyGLRStack* yystackp)
       else
        {
          fprintf (stderr, "Option. rule: %d, state: %ld, next: %ld",
-                  yyp->yyoption.yyrule,
+                  yyp->yyoption.yyrule - 1,
                   (long int) YYINDEX (yyp->yyoption.yystate),
                   (long int) YYINDEX (yyp->yyoption.yynext));
        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]