From: Jérémie Astor Date: Tue, 16 Jun 2020 20:24:44 +0000 (+0200) Subject: :bug: Emit ctor code in unary if needed X-Git-Tag: nightly~1467 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=bb8454c937a5d535285e132b0469c436a44eb13a;p=gwion.git :bug: Emit ctor code in unary if needed --- diff --git a/src/emit/emit.c b/src/emit/emit.c index 9f19e4d5..730c3224 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1233,10 +1233,11 @@ ANN Instr emit_exp_spork(const Emitter emit, const Exp_Unary* unary) { } ANN static m_bool emit_exp_unary(const Emitter emit, const Exp_Unary* unary) { -// no pos ? const Type t = exp_self(unary)->info->type; - if(t->e->def && !GET_FLAG(t, emit)) - CHECK_BB(ensure_emit(emit, t)) + const Type base = get_type(actual_type(emit->gwion, t)); + if(base->e->def && !GET_FLAG(base, emit)) + CHECK_BB(ensure_emit(emit, base)) + // no pos ? struct Op_Import opi = { .op=unary->op, .data=(uintptr_t)unary, .op_type=op_unary }; if(unary->op != insert_symbol("spork") && unary->op != insert_symbol("fork") && unary->exp) { CHECK_BB(emit_exp_pop_next(emit, unary->exp))