diff options
Diffstat (limited to 'testes/gc.lua')
| -rw-r--r-- | testes/gc.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/testes/gc.lua b/testes/gc.lua index 5d2b3085..62713dac 100644 --- a/testes/gc.lua +++ b/testes/gc.lua | |||
| @@ -294,6 +294,16 @@ do -- invalid mode | |||
| 294 | end | 294 | end |
| 295 | 295 | ||
| 296 | 296 | ||
| 297 | if T then -- bug since 5.3: all-weak tables are not being revisited | ||
| 298 | T.gcstate("propagate") | ||
| 299 | local t = setmetatable({}, {__mode = "kv"}) | ||
| 300 | T.gcstate("enteratomic") -- 't' was visited | ||
| 301 | setmetatable(t, {__mode = "kv"}) | ||
| 302 | T.gcstate("pause") -- its new metatable is not being visited | ||
| 303 | assert(getmetatable(t).__mode == "kv") | ||
| 304 | end | ||
| 305 | |||
| 306 | |||
| 297 | -- 'bug' in 5.1 | 307 | -- 'bug' in 5.1 |
| 298 | a = {} | 308 | a = {} |
| 299 | local t = {x = 10} | 309 | local t = {x = 10} |
