From: Jérémie Astor Date: Mon, 4 May 2020 21:34:01 +0000 (+0200) Subject: :art: Improve gack X-Git-Tag: nightly~1684 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=d7207f18c8d7f4b92fdb510b6aceb4579a6d09ce;p=gwion.git :art: Improve gack --- 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);