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 <[EMAIL PROTECTED]>
* 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 [EMAIL PROTECTED]
Daniel Hagerty [EMAIL PROTECTED]
David J. MacKenzie [EMAIL PROTECTED]
+Derek M. Jones [EMAIL PROTECTED]
Dick Streefland [EMAIL PROTECTED]
Enrico Scholz [EMAIL PROTECTED]
Evgeny Stambulchik [EMAIL PROTECTED]
@@ -34,7 +35,7 @@ Jan Nieuwenhuizen [EMAIL PROTECTED]
Jesse Thilo [EMAIL PROTECTED]
Jim Kent [EMAIL PROTECTED]
Jim Meyering [EMAIL PROTECTED]
-Joel E. Denny [EMAIL PROTECTED]
+Joel E. Denny [EMAIL PROTECTED]
Juan Manuel Guerrero [EMAIL PROTECTED]
Kees Zeelenberg [EMAIL PROTECTED]
Keith Browne [EMAIL PROTECTED]
@@ -67,7 +68,7 @@ Raja R Harinath [EMAIL PROTECTED]
Richard Stallman [EMAIL PROTECTED]
Robert Anisko [EMAIL PROTECTED]
Shura [EMAIL PROTECTED]
-Steve Murhpy [EMAIL PROTECTED]
+Steve Murphy [EMAIL PROTECTED]
Tim Josling [EMAIL PROTECTED]
Tim Van Holder [EMAIL PROTECTED]
Tom Lane [EMAIL PROTECTED]
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));
}
_______________________________________________
[email protected] http://lists.gnu.org/mailman/listinfo/help-bison