From 9243c414d92c253edd908f438caa31e2aa16f3f4 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 23 Feb 2018 10:16:18 -0300 Subject: first version of empty entries in tables (so that, in the future, tables can contain regular nil entries) --- ltests.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ltests.c') diff --git a/ltests.c b/ltests.c index 97d1abd4..a5781fb6 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 2.240 2018/01/28 15:13:26 roberto Exp roberto $ +** $Id: ltests.c,v 2.241 2018/02/20 16:52:50 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -254,7 +254,7 @@ static void checktable (global_State *g, Table *h) { for (i = 0; i < h->sizearray; i++) checkvalref(g, hgc, &h->array[i]); for (n = gnode(h, 0); n < limit; n++) { - if (!ttisnil(gval(n))) { + if (!isempty(gval(n))) { TValue k; getnodekey(g->mainthread, &k, n); lua_assert(!keyisnil(n)); @@ -842,7 +842,7 @@ static int table_query (lua_State *L) { else if ((i -= t->sizearray) < sizenode(t)) { TValue k; getnodekey(L, &k, gnode(t, i)); - if (!ttisnil(gval(gnode(t, i))) || + if (!isempty(gval(gnode(t, i))) || ttisnil(&k) || ttisnumber(&k)) { pushobject(L, &k); -- cgit v1.2.3-55-g6feb