core: fix PSP leak in CASE..ENDCASE

This commit is contained in:
Virgil Dupras 2020-04-18 22:05:11 -04:00
parent a2d89de557
commit 29a6ee128d

View File

@ -58,9 +58,9 @@
( During a CASE, the stack grows by 1 at each ENDOF so that ( During a CASE, the stack grows by 1 at each ENDOF so that
we can fill all those ENDOF branching addrs. So that we we can fill all those ENDOF branching addrs. So that we
know when to stop, we put a 0 on PSP. That's our stopgap. ) know when to stop, we put a 0 on PSP. That's our stopgap. )
: CASE 0 ; IMMEDIATE : CASE 0 COMPILE >R ; IMMEDIATE
: OF : OF
COMPILE OVER COMPILE = COMPILE I COMPILE =
[COMPILE] IF [COMPILE] IF
; IMMEDIATE ; IMMEDIATE
: ENDOF [COMPILE] ELSE ; IMMEDIATE : ENDOF [COMPILE] ELSE ; IMMEDIATE
@ -70,10 +70,11 @@
hit 0. ) hit 0. )
: ENDCASE : ENDCASE
BEGIN BEGIN
DUP NOT IF DROP EXIT THEN DUP NOT IF
DROP COMPILE R> COMPILE DROP EXIT
THEN
[COMPILE] THEN [COMPILE] THEN
AGAIN AGAIN
COMPILE DROP
; IMMEDIATE ; IMMEDIATE
: CREATE : CREATE