From e45075b0b048294455eb57fe9c38aabf5fc832cb Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Sat, 21 Sep 2019 00:43:35 +0200 Subject: [PATCH] :art: Move cast_to in emit_exp --- src/emit/emit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.43.0