From: fennecdjay Date: Wed, 7 Dec 2022 13:16:52 +0000 (+0100) Subject: :art: use tflag_compound for compound_release X-Git-Tag: nightly~207^2~66 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=c4a4d35dcfeafe09d7e8d205627e426a6a118679;p=gwion.git :art: use tflag_compound for compound_release --- 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))); } }