From: fennecdjay Date: Sun, 3 Jul 2022 23:00:05 +0000 (+0200) Subject: :bug: Add local if unchecked return is compound X-Git-Tag: nightly~264^2~104 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=66485f55032e525168e79f0a97c2e1fc3ed8a4ef;p=gwion.git :bug: Add local if unchecked return is compound --- 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));