]> Nishi Git Mirror - gwion.git/commitdiff
:art: Improve array_extend inner
authorfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 15 Oct 2019 12:00:32 +0000 (14:00 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 15 Oct 2019 12:00:32 +0000 (14:00 +0200)
src/emit/emit.c

index 41b00d8eb249cd09edcddd54d3fa0ff69ccd0bcb..a0999059abb0b226e76511f3fe0d239b3a72db81 100644 (file)
@@ -249,10 +249,12 @@ ANN2(1,2) m_bool emit_instantiate_object(const Emitter emit, const Type type,
     assert(!arr || arr->depth == type->array_depth);
     const Array_Sub array = arr ?: instantiate_typedef(emit->gwion->mp, type->array_depth);
     assert(array->exp);
-    DECL_OB(ArrayInfo*, info, = emit_array_extend_inner(emit, type, array->exp))
-    info->is_ref = is_ref;
+    ArrayInfo* info = emit_array_extend_inner(emit, type, array->exp);
+    if(info)
+      info->is_ref = is_ref;
     if(!arr)
       free_array_sub(emit->gwion->mp, array);
+    return info ? GW_OK : GW_ERROR;
   } else if(!is_ref) {
     const Instr instr = emit_add_instr(emit, ObjectInstantiate);
     instr->m_val2 = (m_uint)type;