From: Akim Demaille Date: Mon, 21 Jul 2008 09:39:55 +0000 (+0200) Subject: Destroy the lhs symbols after reduction. X-Git-Tag: v2.7.90~1166 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/f8a95c9c128e132407e18872aef6c403727c13e0 Destroy the lhs symbols after reduction. * data/lalr1-fusion.cc (parse): After the user action, when in variant mode, destroy the lhs symbols. --- diff --git a/ChangeLog b/ChangeLog index 28c3ce80..25d5f6fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-03 Akim Demaille + + Destroy the lhs symbols after reduction. + * data/lalr1-fusion.cc (parse): After the user action, when in + variant mode, destroy the lhs symbols. + 2008-11-03 Akim Demaille Simplify yysyntax_error_ use. diff --git a/data/lalr1-fusion.cc b/data/lalr1-fusion.cc index 743a05ac..6299d760 100644 --- a/data/lalr1-fusion.cc +++ b/data/lalr1-fusion.cc @@ -859,10 +859,13 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[; else yyval = yystack_@{0@}.value;])[ + // Compute the default @@$. { slice slice (yystack_, yylen); YYLLOC_DEFAULT (yyloc, slice, yylen); } + + // Perform the reduction. YY_REDUCE_PRINT (yyn); switch (yyn) { @@ -872,6 +875,15 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[; } YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], yyval, yyloc); +]b4_variant_if([ + // Destroy the lhs symbols. + for (unsigned i = 0; i < yylen; ++i) + { + b4_symbol_variant([[yystos_[yystack_@{i@}.state]]], + [[yystack_@{i@}.value]], + [[destroy]]) + }])dnl +[ yypop_ (yylen); yylen = 0; YY_STACK_PRINT ();