From: Jérémie Astor Date: Thu, 21 May 2020 21:22:46 +0000 (+0200) Subject: :art: emit_decl X-Git-Tag: nightly~1530 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=0bfd6d50d77465b3b0b660fe434be9ace42963cc;p=gwion.git :art: emit_decl --- diff --git a/src/emit/emit.c b/src/emit/emit.c index 0b2409e1..d4da531a 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -659,14 +659,14 @@ ANN static m_bool emit_exp_decl_global(const Emitter emit, const Exp_Decl *decl, const m_bool is_array = array && array->exp; const m_bool is_obj = isa(type, emit->gwion->type[et_object]) > 0; const uint emit_addr = (!is_obj || (is_ref && !is_array)) ? emit_var : 1; - if(is_obj && (is_array || !is_ref && !GET_FLAG(v, ref))) + if(is_obj && (is_array || !is_ref) && !GET_FLAG(v, ref)) CHECK_BB(emit_instantiate_object(emit, type, array, is_ref)) const Instr instr = emit_kind(emit, v->type->size, !struct_ctor(v) ? emit_addr : 1, dotstatic); v->d.ptr = mp_calloc2(emit->gwion->mp, v->type->size); SET_FLAG(v, union); instr->m_val = (m_uint)v->d.ptr; instr->m_val2 = v->type->size; - if(is_obj && (is_array || !is_ref && !GET_FLAG(v, ref))) { + if(is_obj && (is_array || !is_ref) && !GET_FLAG(v, ref)) { const Instr assign = emit_add_instr(emit, Assign); const size_t missing_depth = type->array_depth - (array ? array->depth : 0); if(missing_depth && !GET_FLAG(decl->td, force)) {