From e417996910c73dbc8972ab84c19b3268d279270d Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Mon, 19 Sep 2022 10:39:23 +0200 Subject: [PATCH] :art: Low Level plugs --- include/env/type.h | 5 +++-- src/lib/array.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/env/type.h b/include/env/type.h index f101936e..fbe56d9e 100644 --- a/include/env/type.h +++ b/include/env/type.h @@ -47,9 +47,10 @@ struct Type_ { m_str name; Nspc nspc; struct TypeInfo_ *info; - uint64_t size; - uint32_t array_depth; + uint64_t size; + uint64_t actual_size; struct Vector_ effects; // pre-ctor effects + uint32_t array_depth; uint16_t ref; uint16_t weight; ae_flag flag; diff --git a/src/lib/array.c b/src/lib/array.c index 9a535caf..419f3be7 100644 --- a/src/lib/array.c +++ b/src/lib/array.c @@ -38,7 +38,8 @@ ANN M_Object new_array(MemPool p, const Type t, const m_uint length) { const M_Object a = new_object(p, t); const m_uint depth = !tflag(t, tflag_typedef) ? t->array_depth : t->info->parent->array_depth; - const m_uint size = depth > 1 ? SZ_INT : array_base(t)->size; +// const m_uint size = depth > 1 ? SZ_INT : array_base(t)->size; + const m_uint size = depth > 1 ? SZ_INT : array_base(t)->actual_size ?: array_base(t)->size; //ARRAY(a) = new_m_vector(p, size, length); m_vector_init(ARRAY(a), size, length); return a; -- 2.43.0