From 5c647754a687a910ef40a097fbf8f7415561c8aa Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Mon, 10 Nov 2025 18:11:26 +0100 Subject: Run VM events and finalizers in separate state. Reported by Sergey Kaplun. #1403 --- src/lj_obj.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/lj_obj.h') diff --git a/src/lj_obj.h b/src/lj_obj.h index 855727bf..73b186e2 100644 --- a/src/lj_obj.h +++ b/src/lj_obj.h @@ -647,6 +647,7 @@ typedef struct global_State { TValue tmptv, tmptv2; /* Temporary TValues. */ Node nilnode; /* Fallback 1-element hash part (nil key and value). */ TValue registrytv; /* Anchor for registry. */ + GCRef vmthref; /* Link to VM thread. */ GCupval uvhead; /* Head of double-linked list of all open upvalues. */ int32_t hookcount; /* Instruction hook countdown. */ int32_t hookcstart; /* Start count for instruction hook counter. */ @@ -663,6 +664,7 @@ typedef struct global_State { } global_State; #define mainthread(g) (&gcref(g->mainthref)->th) +#define vmthread(g) (&gcref(g->vmthref)->th) #define niltv(L) \ check_exp(tvisnil(&G(L)->nilnode.val), &G(L)->nilnode.val) #define niltvg(g) \ -- cgit v1.2.3-55-g6feb