From c2dc6e8e947ed0c7b18d452592f722f56ee1f96a Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 14 Mar 2025 12:37:19 -0300 Subject: Missing GC barrier in 'luaV_finishset' --- testes/gc.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'testes/gc.lua') diff --git a/testes/gc.lua b/testes/gc.lua index 96eadad8..0693837c 100644 --- a/testes/gc.lua +++ b/testes/gc.lua @@ -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() -- cgit v1.2.3-55-g6feb