bug-bison
[Top][All Lists]
Advanced

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

Re: yacc.c fix to avoid use of uninitialized variables in initial action


From: Akim Demaille
Subject: Re: yacc.c fix to avoid use of uninitialized variables in initial action
Date: Sat, 9 Jul 2005 09:59:22 +0200


Le 9 juil. 05 à 09:17, Paul Eggert a écrit :

I installed this:

2005-07-09  Paul Eggert  <address@hidden>

    * data/yacc.c (yyparse): In the initial action, set
    yylsp[0] and yyvsp[0] rather than yylloc and yylval.
    This avoids the use of undefined variables if the initial
    action does not set yylloc and/or yylval.

But then yylloc is no longer initialized.  I usually initialized
it there, and then it is the scanner that updates it.  I really
meant to have the previous version.

And this value is not used, it is copied.  A tool such as Valgrind
makes the difference.



reply via email to

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