FFI: Turn FFI finalizer table into a proper GC root.

Reported by Sergey Bronnikov. #1168
This commit is contained in:
Mike Pall
2024-04-19 01:33:19 +02:00
parent 7110b93567
commit f5affaa6c4
7 changed files with 39 additions and 44 deletions

View File

@@ -86,7 +86,7 @@ void LJ_FASTCALL lj_cdata_free(global_State *g, GCcdata *cd)
void lj_cdata_setfin(lua_State *L, GCcdata *cd, GCobj *obj, uint32_t it)
{
GCtab *t = ctype_ctsG(G(L))->finalizer;
GCtab *t = tabref(G(L)->gcroot[GCROOT_FFI_FIN]);
if (gcref(t->metatable)) {
/* Add cdata to finalizer table, if still enabled. */
TValue *tv, tmp;