dead objects are not collectable.

This commit is contained in:
Roberto Ierusalimschy
2011-09-24 18:12:01 -03:00
parent 5645a84368
commit 87912786af
3 changed files with 11 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: ltable.c,v 2.62 2011/08/17 20:26:47 roberto Exp roberto $
** $Id: ltable.c,v 2.63 2011/09/15 17:09:02 roberto Exp roberto $
** Lua tables (hash)
** See Copyright Notice in lua.h
*/
@@ -152,7 +152,7 @@ static int findindex (lua_State *L, Table *t, StkId key) {
/* key may be dead already, but it is ok to use it in `next' */
if (luaV_rawequalobj(gkey(n), key) ||
(ttisdeadkey(gkey(n)) && iscollectable(key) &&
gcvalue(gkey(n)) == gcvalue(key))) {
deadvalue(gkey(n)) == gcvalue(key))) {
i = cast_int(n - gnode(t, 0)); /* key index in hash table */
/* hash elements are numbered after array ones */
return i + t->sizearray;