1
0
mirror of https://github.com/lua/lua synced 2026-06-08 15:34:49 +00:00

Bug: Ephemeron table can wrongly collect entry with strong key

This commit is contained in:
Roberto Ierusalimschy
2014-09-01 13:55:08 -03:00
parent 8efe9f23fa
commit f59b241315
+2 -2
View File
@@ -1,5 +1,5 @@
/*
** $Id: lgc.c,v 2.140.1.1 2013/04/12 18:48:47 roberto Exp roberto $
** $Id: lgc.c,v 2.140.1.2 2013/04/26 18:22:05 roberto Exp roberto $
** Garbage Collector
** See Copyright Notice in lua.h
*/
@@ -403,7 +403,7 @@ static int traverseephemeron (global_State *g, Table *h) {
reallymarkobject(g, gcvalue(gval(n))); /* mark it now */
}
}
if (prop)
if (g->gcstate != GCSatomic || prop)
linktable(h, &g->ephemeron); /* have to propagate again */
else if (hasclears) /* does table have white keys? */
linktable(h, &g->allweak); /* may have to clean white keys */