capture freezeGC in CPanic

This commit is contained in:
CPunch 2023-09-05 02:23:31 -05:00
parent 1544332b90
commit 56161a32e7
3 changed files with 3 additions and 0 deletions

View File

@ -12,6 +12,7 @@ CPanic *cosmoV_newPanic(CState *state)
CPanic *panic = cosmoM_xmalloc(state, sizeof(CPanic));
panic->top = state->top;
panic->frameCount = state->frameCount;
panic->freezeGC = state->freezeGC;
panic->prev = state->panic;
state->panic = panic;

View File

@ -46,6 +46,7 @@ typedef struct CPanic
StkPtr top;
struct CPanic *prev;
int frameCount;
int freezeGC;
} CPanic;
struct CState

View File

@ -122,6 +122,7 @@ void cosmoV_throw(CState *state)
if (state->panic) {
state->top = state->panic->top;
state->frameCount = state->panic->frameCount;
state->freezeGC = state->panic->freezeGC;
cosmoV_pushValue(state, val);
longjmp(state->panic->jmp, 1);
} else {