Ensure proper JIT execution context on C callbacks

This commit is contained in:
Nicolas Noble 2023-06-05 06:35:42 -07:00 committed by GitHub
parent 51fb2f2c3a
commit 921db33a9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -681,6 +681,7 @@ lua_State * LJ_FASTCALL lj_ccallback_enter(CTState *cts, void *cf)
lua_State *L = cts->L;
global_State *g = cts->g;
lj_assertG(L != NULL, "uninitialized cts->L in callback");
setgcref(g->cur_L, obj2gco(L));
if (tvref(g->jit_base)) {
setstrV(L, L->top++, lj_err_str(L, LJ_ERR_FFI_BADCBACK));
if (g->panic) g->panic(L);