mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
* data/yacc.c (yyparse): Undo previous patch. Instead,
set yylsp[0] and yyvsp[0] only if the initial action sets yylloc and yylval, respectively.
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
|
2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
|
||||||
|
* data/yacc.c (yyparse): Undo previous patch. Instead,
|
||||||
|
set yylsp[0] and yyvsp[0] only if the initial action
|
||||||
|
sets yylloc and yylval, respectively.
|
||||||
|
|
||||||
* data/yacc.c (yyparse): In the initial action, set
|
* data/yacc.c (yyparse): In the initial action, set
|
||||||
yylsp[0] and yyvsp[0] rather than yylloc and yylval.
|
yylsp[0] and yyvsp[0] rather than yylloc and yylval.
|
||||||
This avoids the use of undefined variables if the initial
|
This avoids the use of undefined variables if the initial
|
||||||
|
|||||||
14
data/yacc.c
14
data/yacc.c
@@ -859,16 +859,20 @@ b4_c_function_def([yyparse], [int], b4_parse_param)
|
|||||||
#endif
|
#endif
|
||||||
]])
|
]])
|
||||||
m4_ifdef([b4_initial_action], [
|
m4_ifdef([b4_initial_action], [
|
||||||
m4_pushdef([b4_at_dollar], [[yylsp[0]]])dnl
|
m4_pushdef([b4_at_dollar], [m4_define([b4_at_dollar_used])yylloc])dnl
|
||||||
m4_pushdef([b4_dollar_dollar], [[yyvsp[0]]])dnl
|
m4_pushdef([b4_dollar_dollar], [m4_define([b4_dollar_dollar_used])yylval])dnl
|
||||||
/* User initialization code. */
|
/* User initialization code. */
|
||||||
b4_initial_action
|
b4_initial_action
|
||||||
m4_popdef([b4_dollar_dollar])dnl
|
m4_popdef([b4_dollar_dollar])dnl
|
||||||
m4_popdef([b4_at_dollar])dnl
|
m4_popdef([b4_at_dollar])dnl
|
||||||
/* Line __line__ of yacc.c. */
|
/* Line __line__ of yacc.c. */
|
||||||
b4_syncline([@oline@], [@ofile@])])dnl
|
b4_syncline([@oline@], [@ofile@])
|
||||||
[
|
])dnl
|
||||||
goto yysetstate;
|
m4_ifdef([b4_dollar_dollar_used],[[ yyvsp[0] = yylval;
|
||||||
|
]])dnl
|
||||||
|
m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
|
||||||
|
]])dnl
|
||||||
|
[ goto yysetstate;
|
||||||
|
|
||||||
/*------------------------------------------------------------.
|
/*------------------------------------------------------------.
|
||||||
| yynewstate -- Push a new state, which is found in yystate. |
|
| yynewstate -- Push a new state, which is found in yystate. |
|
||||||
|
|||||||
Reference in New Issue
Block a user