From 748551238451acf36a245fb2f883293149e2f0ca Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 3 Nov 2015 16:10:44 -0200 Subject: added comment and assert about dead keys --- ltable.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ltable.c') diff --git a/ltable.c b/ltable.c index e47b81f7..13d39dd3 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 2.113 2015/07/04 16:32:34 roberto Exp roberto $ +** $Id: ltable.c,v 2.114 2015/11/03 15:47:30 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -133,6 +133,7 @@ static Node *mainposition (const Table *t, const TValue *key) { case LUA_TLCF: return hashpointer(t, fvalue(key)); default: + lua_assert(!ttisdeadkey(key)); return hashpointer(t, gcvalue(key)); } } @@ -457,7 +458,7 @@ TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key) { Node *f = getfreepos(t); /* get a free place */ if (f == NULL) { /* cannot find a free place? */ rehash(L, t, key); /* grow table */ - /* whatever called 'newkey' takes care of TM cache and GC barrier */ + /* whatever called 'newkey' takes care of TM cache */ return luaH_set(L, t, key); /* insert key into grown table */ } lua_assert(!isdummy(f)); -- cgit v1.2.3-55-g6feb