From: fennecdjay Date: Fri, 20 Sep 2019 22:43:35 +0000 (+0200) Subject: :art: Move cast_to in emit_exp X-Git-Tag: nightly~2215^2~10 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=e45075b0b048294455eb57fe9c38aabf5fc832cb;p=gwion.git :art: Move cast_to in emit_exp --- diff --git a/src/emit/emit.c b/src/emit/emit.c index 88530019..594535dc 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1153,12 +1153,12 @@ DECL_EXP_FUNC(emit) ANN2(1) static m_bool emit_exp(const Emitter emit, Exp exp, const m_bool ref) { do { CHECK_BB(exp_func[exp->exp_type](emit, &exp->d)) - if(exp->cast_to) - CHECK_BB(emit_implicit_cast(emit, exp, exp->cast_to)) if(ref && isa(exp->type, t_object) > 0 && isa(exp->type, t_shred) < 0 ) { // beware fork const Instr instr = emit_add_instr(emit, RegAddRef); instr->m_val = exp->emit_var; } + if(exp->cast_to) + CHECK_BB(emit_implicit_cast(emit, exp, exp->cast_to)) if(emit->env->func && isa(exp->type, t_lambda) < 0 && isa(exp->type, t_function) > 0 && !GET_FLAG(exp->type->e->d.func->value_ref->d.func_ref, pure)) UNSET_FLAG(emit->env->func, pure);