(yyreturn): Don't pop stack if yyinitStateSet failed,

as the stack isn't valid in that case.
This commit is contained in:
Paul Eggert
2005-07-20 21:43:32 +00:00
parent dc9701e848
commit 6fdb09caac

View File

@@ -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;