lalr1.cc: check (and fix) %initial-action exception safety

* data/lalr1.cc: Check size > 1, rather than size != 1, when cleaning
the stack, as at the beginning, size is 0.
* tests/c++.at (Exception safety): Check exception safety in
%initial-action.
This commit is contained in:
Akim Demaille
2012-09-25 11:17:55 +02:00
parent 7e1fabbeae
commit a26424642b
2 changed files with 21 additions and 7 deletions

View File

@@ -828,7 +828,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
yypop_ (yylen);
while (yystate_stack_.height () != 1)
while (1 < yystate_stack_.height ())
{
yydestruct_ ("Cleanup: popping",
yystos_[yystate_stack_[0]],
@@ -852,7 +852,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
&yylloc);
}
while (yystate_stack_.height () != 1)
while (1 < yystate_stack_.height ())
{
yydestruct_ ("Cleanup: popping",
yystos_[yystate_stack_[0]],