From a28eef3027cc2a5e8556f9a67e6ac21f54946059 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 6 Dec 2022 19:45:03 +0100 Subject: [PATCH] :art: improve free_captures --- src/lib/closure.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/closure.c b/src/lib/closure.c index 53b4d124..d58ba0ce 100644 --- a/src/lib/closure.c +++ b/src/lib/closure.c @@ -84,15 +84,15 @@ ANN Type upvalue_type(const Env env, Capture *cap) { } ANN void free_captures(const VM_Shred shred, m_bit *const caps) { - uint32_t sz = 0; + uint32_t sz = SZ_INT; const Capture_List captures = (*(Func_Def*)caps)->captures; for(m_uint i = 0; i < captures->len; i++) { Capture *const cap = mp_vector_at(captures, Capture, i); if(tflag(cap->temp->type, tflag_compound)) - compound_release(shred, cap->temp->type, caps + SZ_INT + sz); + compound_release(shred, cap->temp->type, caps + sz); sz += cap->temp->type->size; } - mp_free2(shred->info->mp, sz + SZ_INT, caps); + mp_free2(shred->info->mp, sz, caps); } static INSTR(fptr_capture) { -- 2.43.0