From: Jérémie Astor Date: Wed, 6 May 2020 11:48:39 +0000 (+0200) Subject: :bug: Fix ArrayDtor (there is no array if error in ctor) X-Git-Tag: nightly~1665 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=8b4d3b58428666806552ad1303296bfc1aa3b5b9;p=gwion.git :bug: Fix ArrayDtor (there is no array if error in ctor) --- diff --git a/src/lib/array.c b/src/lib/array.c index 3d54713a..dd78610f 100644 --- a/src/lib/array.c +++ b/src/lib/array.c @@ -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);