diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-03-14 12:37:19 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-03-14 12:37:19 -0300 |
commit | c2dc6e8e947ed0c7b18d452592f722f56ee1f96a (patch) | |
tree | 2d39698d94992e158199db58d53693496250d2b6 /testes/gc.lua | |
parent | 22974326ca0d4f893849ce722cc1d65b3e228f42 (diff) | |
download | lua-c2dc6e8e947ed0c7b18d452592f722f56ee1f96a.tar.gz lua-c2dc6e8e947ed0c7b18d452592f722f56ee1f96a.tar.bz2 lua-c2dc6e8e947ed0c7b18d452592f722f56ee1f96a.zip |
Missing GC barrier in 'luaV_finishset'
Diffstat (limited to 'testes/gc.lua')
-rw-r--r-- | testes/gc.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/testes/gc.lua b/testes/gc.lua index 96eadad8..0693837c 100644 --- a/testes/gc.lua +++ b/testes/gc.lua | |||
@@ -601,6 +601,21 @@ end | |||
601 | 601 | ||
602 | 602 | ||
603 | if T then | 603 | if T then |
604 | collectgarbage("stop") | ||
605 | T.gcstate("pause") | ||
606 | local sup = {x = 0} | ||
607 | local a = setmetatable({}, {__newindex = sup}) | ||
608 | T.gcstate("enteratomic") | ||
609 | assert(T.gccolor(sup) == "black") | ||
610 | a.x = {} -- should not break the invariant | ||
611 | assert(not (T.gccolor(sup) == "black" and T.gccolor(sup.x) == "white")) | ||
612 | T.gcstate("pause") -- complete the GC cycle | ||
613 | sup.x.y = 10 | ||
614 | collectgarbage("restart") | ||
615 | end | ||
616 | |||
617 | |||
618 | if T then | ||
604 | print("emergency collections") | 619 | print("emergency collections") |
605 | collectgarbage() | 620 | collectgarbage() |
606 | collectgarbage() | 621 | collectgarbage() |