diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-12-27 21:58:19 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-12-27 21:58:19 +0200 |
commit | 3828539937082db7ceb14252ceec531419122d21 (patch) | |
tree | d28bd7d72773602aa1eef3048d93e08ed95084da /awkgram.c | |
parent | f1612fd046124ff68fcdd70b558484c87c907bce (diff) | |
parent | 0bf047964956e90481de3941768937c4318db948 (diff) | |
download | egawk-3828539937082db7ceb14252ceec531419122d21.tar.gz egawk-3828539937082db7ceb14252ceec531419122d21.tar.bz2 egawk-3828539937082db7ceb14252ceec531419122d21.zip |
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'awkgram.c')
-rw-r--r-- | awkgram.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -7673,14 +7673,12 @@ mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch, */ INSTRUCTION *ip; + bool setup_else_part = true; if (false_branch == NULL) { false_branch = list_create(instruction(Op_no_op)); - if (elsep != NULL) { /* else { } */ - if (do_pretty_print) - (void) list_prepend(false_branch, elsep); - else - bcfree(elsep); + if (elsep == NULL) { /* else { } */ + setup_else_part = false; } } else { /* assert(elsep != NULL); */ @@ -7688,6 +7686,9 @@ mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch, /* avoid a series of no_op's: if .. else if .. else if .. */ if (false_branch->lasti->opcode != Op_no_op) (void) list_append(false_branch, instruction(Op_no_op)); + } + + if (setup_else_part) { if (do_pretty_print) { (void) list_prepend(false_branch, elsep); false_branch->nexti->branch_end = false_branch->lasti; |