From: erg Date: Tue, 14 Dec 2010 20:26:16 +0000 (+0000) Subject: Convert top-level empty action blocks to a trivial action, since empty blocks X-Git-Tag: LAST_LIBGRAPH~32^2~1128 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=75ac2df8f341cc577656151f405768edd8d3dd66;p=graphviz Convert top-level empty action blocks to a trivial action, since empty blocks should not be the same as missing blocks. --- diff --git a/lib/gvpr/compile.c b/lib/gvpr/compile.c index a85911fb0..e882c9bfd 100644 --- a/lib/gvpr/compile.c +++ b/lib/gvpr/compile.c @@ -2282,6 +2282,16 @@ static case_stmt *mkStmts(Expr_t * prog, char *src, case_info * sp, cs[i].action = compile(prog, src, sp->action, sp->astart, sfstruse(tmps), 0, INTEGER); if (getErrorErrors()) break; + /* If no error but no compiled action, the input action must + * have been essentially an empty block, which should be + * considered different from a missing block. So, compile a + * trivial block. + */ + if (!cs[i].action) { + sfprintf(tmps, "%s__a%d", lbl, i); + cs[i].action = compile(prog, src, "1", sp->astart, + sfstruse(tmps), 0, INTEGER); + } } sp = sp->next; }