[Top][All Lists]

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

Re: bison valgrind

From: Paul Hilfinger
Subject: Re: bison valgrind
Date: Fri, 08 Jul 2005 19:57:43 -0700

This is actually Akim's code rather than mine, so I'm a tad uncertain as
to the "correct" fix.  The problem, at least, is clear: when entering
the error-recovery code as a result of YYERROR, yyerror_range[1] is 
uninitialized.  I request a second set of eyes take a look at the
suggested patch below, inspired by yacc.c, and tell me what you think.

I'll install it if I get feedback within the next day; otherwise, it
will have to wait until I return in a week.

Paul Hilfinger

Index: bison-1_5.103/data/glr.c
--- bison-1_5.103/data/glr.c Fri, 08 Jul 2005 14:48:04 -0700 hilfingr 
(glrbison/e/14_glr-parser 644)
+++ bison-1_5.103(w)/data/glr.c Fri, 08 Jul 2005 19:39:18 -0700 hilfingr 
(glrbison/e/14_glr-parser 644)
@@ -781,7 +781,8 @@ yyuserAction (yyRuleNum yyn, int yyrhsle
     *yyvalp = yyvsp[YYFILL (1-yyrhslen)].yystate.yysemantics.yysval;
   YYLLOC_DEFAULT (*yylocp, yyvsp - yyrhslen, yyrhslen);
+]b4_location_if([[  yystack->yyerror_range[1].yystate.yyloc = *yylocp;
   switch (yyn)

reply via email to

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