mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 01:03: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])[);
|
yytoken, yylvalp]b4_location_if([, yyllocp])[);
|
||||||
|
|
||||||
/* Now pop stack until empty, destroying its entries as we go. */
|
/* Now pop stack until empty, destroying its entries as we go. */
|
||||||
while (yystack.yytops.yystates[0] != NULL)
|
{
|
||||||
{
|
yyGLRState** yystates = yystack.yytops.yystates;
|
||||||
yyGLRState *yys = yystack.yytops.yystates[0];
|
if (yystates)
|
||||||
]b4_location_if([[ yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;]])[
|
while (yystates[0])
|
||||||
yydestruct ("Error: popping",
|
{
|
||||||
yystos[yys->yylrState],
|
yyGLRState *yys = yystates[0];
|
||||||
&yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[);
|
]b4_location_if([[ yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;]]
|
||||||
yystack.yytops.yystates[0] = yys->yypred;
|
)[ yydestruct ("Error: popping",
|
||||||
yystack.yynextFree -= 1;
|
yystos[yys->yylrState],
|
||||||
yystack.yyspaceLeft += 1;
|
&yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[);
|
||||||
}
|
yystates[0] = yys->yypred;
|
||||||
|
yystack.yynextFree -= 1;
|
||||||
|
yystack.yyspaceLeft += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
yyfreeGLRStack (&yystack);
|
yyfreeGLRStack (&yystack);
|
||||||
return yyresult;
|
return yyresult;
|
||||||
|
|||||||
Reference in New Issue
Block a user