mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-19 21:43:27 +00:00
Ensure proper JIT execution context on C callbacks
This commit is contained in:
parent
51fb2f2c3a
commit
921db33a9a
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user