]> Nishi Git Mirror - gwion.git/commitdiff
:bug: Fix ArrayDtor (there is no array if error in ctor)
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Wed, 6 May 2020 11:48:39 +0000 (13:48 +0200)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Wed, 6 May 2020 11:48:39 +0000 (13:48 +0200)
src/lib/array.c

index 3d54713a5b722412e6b0cda2a7d180023b4318bb..dd78610f5627c8bd3549be93b28b18925c7eb7c0 100644 (file)
@@ -56,6 +56,8 @@ static DTOR(array_dtor) {
   const Type t = !GET_FLAG(o->type_ref, nonnull) ?
     o->type_ref : o->type_ref->e->parent;
   struct M_Vector_* a = ARRAY(o);
+  if(!a)
+    return;
   if(t->array_depth > 1 || is_array(shred->info->vm->gwion->type, t))
     for(m_uint i = 0; i < ARRAY_LEN(a); ++i)
       release(*(M_Object*)(ARRAY_PTR(a) + i * SZ_INT), shred);