Bug fix: Old finalized object may not be visited by GC

When an object aged OLD1 is finalized, it is moved from the list
'finobj' to the *beginning* of the list 'allgc'. So, this part of the
list (and not only the survival list) must be visited by 'markold'.
This commit is contained in:
Roberto Ierusalimschy 2020-07-13 10:58:44 -03:00
parent 3e1dc3bc67
commit 3b2444f7ee
1 changed files with 1 additions and 1 deletions

2
lgc.c
View File

@ -1140,7 +1140,7 @@ static void finishgencycle (lua_State *L, global_State *g) {
static void youngcollection (lua_State *L, global_State *g) {
GCObject **psurvival; /* to point to first non-dead survival object */
lua_assert(g->gcstate == GCSpropagate);
markold(g, g->survival, g->reallyold);
markold(g, g->allgc, g->reallyold);
markold(g, g->finobj, g->finobjrold);
atomic(L);