From 66485f55032e525168e79f0a97c2e1fc3ed8a4ef Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Mon, 4 Jul 2022 01:00:05 +0200 Subject: [PATCH] :bug: Add local if unchecked return is compound --- src/emit/emit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/emit/emit.c b/src/emit/emit.c index 4c321da6..4f170060 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -2008,6 +2008,8 @@ ANN static m_bool emit_stmt_return(const Emitter emit, const Stmt_Exp stmt) { if (stmt->val->exp_type == ae_exp_call && emit->env->func == f) return optimize_tail_call(emit, &stmt->val->d.exp_call); } + if(!stmt->val->ref && isa(stmt->val->type, emit->gwion->type[et_compound]) > 0) + emit_local(emit, stmt->val->type); CHECK_BB(emit_exp(emit, stmt->val)); } vector_add(&emit->code->stack_return, (vtype)emit_add_instr(emit, Goto)); -- 2.43.0