commit 71752074d1f3f7b75fb06302bff64705482318fd
parent e7953cb265bc16511687a1c4ebf7975aa5d849d0
Author: Drew DeVault <sir@cmpwn.com>
Date: Mon, 8 Feb 2021 13:58:55 -0500
Fix defers on terminating expression list
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/gen.c b/src/gen.c
@@ -1617,7 +1617,9 @@ gen_expr_list(struct gen_context *ctx,
exprs = exprs->next;
}
- gen_defers(ctx, ctx->scope);
+ if (!expr->terminates) {
+ gen_defers(ctx, ctx->scope);
+ }
pop_scope(ctx);
push(&ctx->current->body, &endl);
}