mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
(yyreturn): Don't pop stack if yyinitStateSet failed,
as the stack isn't valid in that case.
This commit is contained in:
26
data/glr.c
26
data/glr.c
@@ -2107,17 +2107,21 @@ b4_syncline([@oline@], [@ofile@])])dnl
|
||||
yytoken, yylvalp]b4_location_if([, yyllocp])[);
|
||||
|
||||
/* Now pop stack until empty, destroying its entries as we go. */
|
||||
while (yystack.yytops.yystates[0] != NULL)
|
||||
{
|
||||
yyGLRState *yys = yystack.yytops.yystates[0];
|
||||
]b4_location_if([[ yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;]])[
|
||||
yydestruct ("Error: popping",
|
||||
yystos[yys->yylrState],
|
||||
&yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[);
|
||||
yystack.yytops.yystates[0] = yys->yypred;
|
||||
yystack.yynextFree -= 1;
|
||||
yystack.yyspaceLeft += 1;
|
||||
}
|
||||
{
|
||||
yyGLRState** yystates = yystack.yytops.yystates;
|
||||
if (yystates)
|
||||
while (yystates[0])
|
||||
{
|
||||
yyGLRState *yys = yystates[0];
|
||||
]b4_location_if([[ yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;]]
|
||||
)[ yydestruct ("Error: popping",
|
||||
yystos[yys->yylrState],
|
||||
&yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[);
|
||||
yystates[0] = yys->yypred;
|
||||
yystack.yynextFree -= 1;
|
||||
yystack.yyspaceLeft += 1;
|
||||
}
|
||||
}
|
||||
|
||||
yyfreeGLRStack (&yystack);
|
||||
return yyresult;
|
||||
|
||||
Reference in New Issue
Block a user