In gen. GC, some gray objects stay in gray lists

In generational collection, objects marked as touched1 stay in gray
lists between collections. This commit fixes a bug introduced in
commit 808976bb59.
This commit is contained in:
Roberto Ierusalimschy
2025-04-15 17:00:30 -03:00
parent 3dd8ea54da
commit 3dbb1a4b89
2 changed files with 9 additions and 2 deletions

View File

@@ -1544,8 +1544,10 @@ static KOption getdetails (Header *h, size_t totalsize, const char **fmt,
else {
if (align > h->maxalign) /* enforce maximum alignment */
align = h->maxalign;
if (l_unlikely(!ispow2(align))) /* not a power of 2? */
if (l_unlikely(!ispow2(align))) { /* not a power of 2? */
*ntoalign = 0; /* to avoid warnings */
luaL_argerror(h->L, 1, "format asks for alignment not power of 2");
}
else {
/* 'szmoda' = totalsize % align */
unsigned szmoda = cast_uint(totalsize & (align - 1));