From bb8454c937a5d535285e132b0469c436a44eb13a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Tue, 16 Jun 2020 22:24:44 +0200 Subject: [PATCH] :bug: Emit ctor code in unary if needed --- src/emit/emit.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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)) -- 2.43.0