From: Jérémie Astor Date: Tue, 3 Aug 2021 15:12:13 +0000 (+0200) Subject: :art: Fix static arrays X-Git-Tag: nightly~499 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=2cb85195b4b32b5ed5feb5218523e4f19cfb58ba;p=gwion.git :art: Fix static arrays --- diff --git a/src/emit/emit.c b/src/emit/emit.c index 13714235..2defb25d 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -813,7 +813,8 @@ ANN static m_bool decl_static(const Emitter emit, const Exp_Decl *decl, emit_instantiate_decl(emit, v->type, decl->td, var_decl->array, is_ref)); CHECK_BB(emit_dot_static_data(emit, v, 1)); emit_add_instr(emit, Assign); - (void)emit_object_addref(emit, -SZ_INT, 0); + if(get_depth(var_decl->value->type) && !is_ref) + (void)emit_object_addref(emit, -SZ_INT, 0); regpop(emit, SZ_INT); emit->code = code; return GW_OK;