Merge branch 'master' into v2.1

This commit is contained in:
Mike Pall 2026-08-18 15:04:33 +02:00
commit 941ddb5c96
2 changed files with 5 additions and 0 deletions

View File

@ -722,6 +722,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");
lj_assertG(!isdead(g, obj2gco(L)), "dead cts->L in callback");
if (tvref(g->jit_base)) {
setstrV(L, L->top++, lj_err_str(L, LJ_ERR_FFI_BADCBACK));
if (g->panic) g->panic(L);

View File

@ -629,6 +629,10 @@ static void atomic(global_State *g, lua_State *L)
setgcrefnull(g->gc.weak);
lj_assertG(!iswhite(obj2gco(mainthread(g))), "main thread turned white");
gc_markobj(g, L); /* Mark running thread. */
#if LJ_HASFFI
if (ctype_ctsG(g) && ctype_ctsG(g)->L) /* Mark cts->L thread. */
gc_markobj(g, ctype_ctsG(g)->L);
#endif
gc_traverse_curtrace(g); /* Traverse current trace. */
gc_mark_gcroot(g); /* Mark GC roots (again). */
gc_propagate_gray(g); /* Propagate all of the above. */