From e8d286da3b8a713c9b8c07f5a3bfb20c7cfba3af Mon Sep 17 00:00:00 2001 From: dzaima Date: Fri, 19 May 2023 22:39:44 +0300 Subject: [PATCH] proper in-place updating in compile() --- src/vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vm.c b/src/vm.c index 4b5cd8f6..e6d6b66c 100644 --- a/src/vm.c +++ b/src/vm.c @@ -468,7 +468,7 @@ NOINLINE Block* compile(B bcq, B objs, B allBlocks, B allBodies, B indices, B to HArr* objArr = (HArr*)cpyHArr(objs); comp->objs = objArr; usz objAm = PIA(objArr); - for (usz i = 0; i < objAm; i++) objArr->a[i] = squeeze_deep(objArr->a[i]); + for (usz i = 0; i < objAm; i++) { B* c=objArr->a+i; B v=*c; *c=m_f64(0); *c = squeeze_deep(v); } if (!q_N(src) && !q_N(indices)) { if (isAtm(indices) || RNK(indices)!=1 || IA(indices)!=2) thrM("VM compiler: Bad indices");