From 0c882636594c710a141ffb81709afc221dd91a20 Mon Sep 17 00:00:00 2001 From: dzaima Date: Sat, 14 Sep 2024 17:16:48 +0300 Subject: [PATCH] don't copy i32slice bytecode in compileAll --- src/vm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vm.c b/src/vm.c index ae8ad10d..3e87feee 100644 --- a/src/vm.c +++ b/src/vm.c @@ -453,11 +453,11 @@ Block* compileBlock(B block, Comp* comp, bool* bDone, u32* bc, usz bcIA, B allBl // consumes all; assumes arguments are valid (verifies some stuff, but definitely not everything) // if sc isn't NULL, this block must only be evaluated directly in that scope precisely once -NOINLINE Block* compileAll(B bcq, B objs, B allBlocks, B allBodies, B indices, B tokenInfo, B src, B fullpath, Scope* sc, i32 nsResult) { +NOINLINE Block* compileAll(B bc_obj, B objs, B allBlocks, B allBodies, B indices, B tokenInfo, B src, B fullpath, Scope* sc, i32 nsResult) { usz bIA = IA(allBlocks); - I32Arr* bca = toI32Arr(bcq); - u32* bc = (u32*)bca->a; - usz bcIA = PIA(bca); + bc_obj = toI32Any(bc_obj); + u32* bc = (u32*)i32any_ptr(bc_obj); + usz bcIA = IA(bc_obj); Comp* comp = mm_alloc(sizeof(Comp), t_comp); NOGC_S; comp->indices = indices; @@ -494,7 +494,7 @@ NOINLINE Block* compileAll(B bcq, B objs, B allBlocks, B allBodies, B indices, B for (usz i = 0; i < bIA; i++) bDone[i] = false; Block* ret = compileBlock(IGetU(allBlocks, 0), comp, bDone, bc, bcIA, allBlocks, allBodies, nameList, sc, 0, 0, nsResult); TFREE(bDone); - ptr_dec(comp); decG(allBlocks); decG(allBodies); dec(tokenInfo); decG(taga(bca)); + ptr_dec(comp); decG(allBlocks); decG(allBodies); dec(tokenInfo); decG(bc_obj); return ret; }