From 8b4d3b58428666806552ad1303296bfc1aa3b5b9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Wed, 6 May 2020 13:48:39 +0200 Subject: [PATCH] :bug: Fix ArrayDtor (there is no array if error in ctor) --- src/lib/array.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.43.0