From d7207f18c8d7f4b92fdb510b6aceb4579a6d09ce Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 4 May 2020 23:34:01 +0200 Subject: [PATCH] :art: Improve gack --- src/emit/emit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/emit/emit.c b/src/emit/emit.c index 93096d75..93b27452 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -494,7 +494,7 @@ ANN static inline void struct_interp(const Emitter emit, const Exp e) { ANN static void interp_multi(const Emitter emit, Var_Decl_List list) { m_uint offset = 0; while(list->next) { - offset += SZ_INT; + offset += list->self->value->type->size; list = list->next; } if(offset) @@ -512,10 +512,10 @@ ANN static m_bool emit_interp(const Emitter emit, const Exp exp) { e->next = next; return GW_ERROR; } - const m_bool isobj = isa(e->info->type, emit->gwion->type[et_object]) > 0; - if(isobj && e->exp_type == ae_exp_decl) // why only objects? + if(e->exp_type == ae_exp_decl) // why only objects? interp_multi(emit, e->d.exp_decl.list); regseti(emit, (m_uint)e->info->type); + const m_bool isobj = isa(e->info->type, emit->gwion->type[et_object]) > 0; if(isobj && !GET_FLAG(e->info->type, force)) emit_add_instr(emit, GackType); const Instr instr = emit_add_instr(emit, Gack); -- 2.43.0