From 6701a63a6307ce88f6d8af05cd7c9e33f2b59b3d Mon Sep 17 00:00:00 2001 From: CPunch Date: Tue, 5 Sep 2023 02:23:31 -0500 Subject: [PATCH] capture freezeGC in CPanic --- src/cstate.c | 1 + src/cstate.h | 1 + src/cvm.c | 1 + 3 files changed, 3 insertions(+) diff --git a/src/cstate.c b/src/cstate.c index f416715..81a084b 100644 --- a/src/cstate.c +++ b/src/cstate.c @@ -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; diff --git a/src/cstate.h b/src/cstate.h index f000672..a527ec8 100644 --- a/src/cstate.h +++ b/src/cstate.h @@ -46,6 +46,7 @@ typedef struct CPanic StkPtr top; struct CPanic *prev; int frameCount; + int freezeGC; } CPanic; struct CState diff --git a/src/cvm.c b/src/cvm.c index dda138b..7e91b04 100644 --- a/src/cvm.c +++ b/src/cvm.c @@ -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 {