Missing GC barrier in 'luaV_finishset'

This commit is contained in:
Roberto Ierusalimschy
2025-03-14 12:37:19 -03:00
parent 22974326ca
commit c2dc6e8e94
3 changed files with 19 additions and 3 deletions

View File

@@ -600,6 +600,21 @@ if T then
end
if T then
collectgarbage("stop")
T.gcstate("pause")
local sup = {x = 0}
local a = setmetatable({}, {__newindex = sup})
T.gcstate("enteratomic")
assert(T.gccolor(sup) == "black")
a.x = {} -- should not break the invariant
assert(not (T.gccolor(sup) == "black" and T.gccolor(sup.x) == "white"))
T.gcstate("pause") -- complete the GC cycle
sup.x.y = 10
collectgarbage("restart")
end
if T then
print("emergency collections")
collectgarbage()