+ /* If the stack is well-formed, pop the stack until it is empty,
+ destroying its entries as we go. But free the stack regardless
+ of whether it is well-formed. */
+ if (yystack.yyitems)
+ {
+ 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;