mirror of
https://github.com/lua/lua
synced 2024-11-22 04:41:23 +03:00
Bug: Ephemeron table can wrongly collect entry with strong key
This commit is contained in:
parent
8efe9f23fa
commit
f59b241315
4
lgc.c
4
lgc.c
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user