mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-20 05:53:26 +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;
|
lua_State *L = cts->L;
|
||||||
global_State *g = cts->g;
|
global_State *g = cts->g;
|
||||||
lj_assertG(L != NULL, "uninitialized cts->L in callback");
|
lj_assertG(L != NULL, "uninitialized cts->L in callback");
|
||||||
|
setgcref(g->cur_L, obj2gco(L));
|
||||||
if (tvref(g->jit_base)) {
|
if (tvref(g->jit_base)) {
|
||||||
setstrV(L, L->top++, lj_err_str(L, LJ_ERR_FFI_BADCBACK));
|
setstrV(L, L->top++, lj_err_str(L, LJ_ERR_FFI_BADCBACK));
|
||||||
if (g->panic) g->panic(L);
|
if (g->panic) g->panic(L);
|
||||||
|
Loading…
Reference in New Issue
Block a user