From a53d9b66ca6247818acaf41e28cdf123082a272b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 25 Jan 2001 14:45:36 -0200 Subject: first implementation for type names --- ltable.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ltable.c') diff --git a/ltable.c b/ltable.c index 81406e05..926fb49e 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 1.65 2001/01/19 13:20:30 roberto Exp roberto $ +** $Id: ltable.c,v 1.66 2001/01/24 15:45:33 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -236,6 +236,7 @@ static TObject *newkey (lua_State *L, Hash *t, Node *mp, const TObject *key) { othern->next = n; /* redo the chain with `n' in place of `mp' */ *n = *mp; /* copy colliding node into free pos. (mp->next also goes) */ mp->next = NULL; /* now `mp' is free */ + setnilvalue(&mp->val); } else { /* colliding node is in its own main position */ /* new node will go into free position */ @@ -245,6 +246,7 @@ static TObject *newkey (lua_State *L, Hash *t, Node *mp, const TObject *key) { } } setobj(&mp->key, key); + lua_assert(ttype(&mp->val) == LUA_TNIL); for (;;) { /* correct `firstfree' */ if (ttype(&t->firstfree->key) == LUA_TNIL) return &mp->val; /* OK; table still has a free place */ -- cgit v1.2.3-55-g6feb