From de56be6c01bdb2747b93a5072591f2af29363f2d Mon Sep 17 00:00:00 2001 From: Marisa Heit Date: Thu, 13 Oct 2016 21:41:54 -0500 Subject: [PATCH] Lemon update 2016-04-29 11:28:35 on branch trunk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit — Lemon bug fix: Do not merge action routines unless their destructors are also identical. Problem and suggested fix reported on the mailing list by Kelvin Sherlock. (user: drh) --- tools/lemon/lemon.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/lemon/lemon.c b/tools/lemon/lemon.c index 546cf515ea..c796f4f126 100644 --- a/tools/lemon/lemon.c +++ b/tools/lemon/lemon.c @@ -4404,7 +4404,8 @@ void ReportTable( writeRuleText(out, rp); fprintf(out," */\n"); lineno++; for(rp2=rp->next; rp2; rp2=rp2->next){ - if( rp2->code==rp->code ){ + if( rp2->code==rp->code && rp2->codePrefix==rp->codePrefix + && rp2->codeSuffix == rp->codeSuffix ){ fprintf(out," case %d: /*",rp2->iRule); writeRuleText(out, rp2); fprintf(out, " */ yytestcase(yyruleno==%d);\n", rp2->iRule); lineno++; @@ -4413,7 +4414,7 @@ void ReportTable( } emit_code(out,rp,lemp,&lineno); fprintf(out," break;\n"); lineno++; - rp->code = 0; + rp->code = 0; } /* Finally, output the default: rule. We choose as the default: all ** empty actions. */