From c4a4d35dcfeafe09d7e8d205627e426a6a118679 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Wed, 7 Dec 2022 14:16:52 +0100 Subject: [PATCH] :art: use tflag_compound for compound_release --- include/object.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/object.h b/include/object.h index 6223889b..f2157ee5 100644 --- a/include/object.h +++ b/include/object.h @@ -60,13 +60,12 @@ static inline void struct_addref(const Gwion gwion, const Type type, const m_bit *ptr) { for (m_uint i = 0; i < vector_size(&type->info->tuple->types); ++i) { const Type t = (Type)vector_at(&type->info->tuple->types, i); - if (isa(t, gwion->type[et_object]) > 0) { - const M_Object o = + if (tflag(t, tflag_compound)) { + if (!tflag(t, tflag_struct)) { + const M_Object o = *(M_Object *)(ptr + vector_at(&type->info->tuple->offset, i)); - ++o->ref; - } else if (tflag(t, tflag_struct)) { - struct_addref( - gwion, t, + if(o) o->ref++; + } else struct_addref(gwion, t, *(m_bit **)(ptr + vector_at(&type->info->tuple->offset, i))); } } -- 2.43.0