bison-patches
[Top][All Lists]
Advanced

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

Re: push parser


From: Bob Rossi
Subject: Re: push parser
Date: Wed, 11 Oct 2006 13:42:27 -0400
User-agent: Mutt/1.5.11

On Wed, Oct 11, 2006 at 09:36:43AM -0700, Paul Eggert wrote:
> Bob Rossi <address@hidden> writes:
> 
> > I have absolutly no idea what yymsgbuf is used for.
> 
> It's used to construct an error message that is passed to
> yysyntax_error.  yysyntax_error is not supposed to assume that the
> message is in static storage, so it's OK to make it auto.
> 
> > What do you think?
> 
> That looks good, except there's a memory leak if the push
> parser outputs a long diagnostic (thus calling malloc for
> yymsg), and then exits.  I installed the following patch
> instead; I hope it works for you (at least, "make check"
> passes).

I had to make this change to get push.c to pass the test suite.

Bob Rossi

Index: push.c
===================================================================
RCS file: /sources/bison/bison/data/push.c,v
retrieving revision 1.4
diff -u -r1.4 push.c
--- push.c      11 Oct 2006 16:35:34 -0000      1.4
+++ push.c      11 Oct 2006 17:40:39 -0000
@@ -1391,7 +1391,7 @@
        pv->yyval = yyval;
        ]b4_locations_if([pv->yyloc = yyloc;])[
        goto yypushreturn;
-gottoken:])
+gottoken:])[
       YYDPRINTF ((stderr, "Reading a token: "));
       ]b4_push_if([], [yychar = YYLEX;])[
     }




reply via email to

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