more correct stack height going negative check
This commit is contained in:
parent
c1b66c5982
commit
6b90615896
2
src/vm.c
2
src/vm.c
@ -362,8 +362,8 @@ Block* compileBlock(B block, Comp* comp, bool* bDone, u32* bc, usz bcIA, B allBl
|
||||
#undef A64
|
||||
usz nlen = TSSIZE(newBC)-TSSIZE(mapBC);
|
||||
for (usz i = 0; i < nlen; i++) TSADD(mapBC, c-bc);
|
||||
if (h-stackConsumed(c)<0) thrM("VM compiler: Stack size goes negative");
|
||||
h+= stackDiff(c);
|
||||
if (h<0) thrM("VM compiler: Stack size goes negative");
|
||||
if (h>hM) hM = h;
|
||||
if (ret) break;
|
||||
c = n;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user