]> Nishi Git Mirror - gwion.git/commitdiff
:art: Fix static arrays
authorJérémie Astor <fennecdjay@gmail.com>
Tue, 3 Aug 2021 15:12:13 +0000 (17:12 +0200)
committerJérémie Astor <fennecdjay@gmail.com>
Tue, 3 Aug 2021 15:12:13 +0000 (17:12 +0200)
src/emit/emit.c

index 13714235972781b8cdb655f45791b14898a876e3..2defb25da34ad8020f42c8349ee373a9f088a23f 100644 (file)
@@ -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;