aboutsummaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-02-23 10:16:18 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-02-23 10:16:18 -0300
commit9243c414d92c253edd908f438caa31e2aa16f3f4 (patch)
treee8959a48f4672037aef061cc6eb82bba21d0766b /ltests.c
parent477ca2fe8ceaf79038972977915987adbef0e425 (diff)
downloadlua-9243c414d92c253edd908f438caa31e2aa16f3f4.tar.gz
lua-9243c414d92c253edd908f438caa31e2aa16f3f4.tar.bz2
lua-9243c414d92c253edd908f438caa31e2aa16f3f4.zip
first version of empty entries in tables
(so that, in the future, tables can contain regular nil entries)
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ltests.c b/ltests.c
index 97d1abd4..a5781fb6 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 2.240 2018/01/28 15:13:26 roberto Exp roberto $ 2** $Id: ltests.c,v 2.241 2018/02/20 16:52:50 roberto Exp roberto $
3** Internal Module for Debugging of the Lua Implementation 3** Internal Module for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -254,7 +254,7 @@ static void checktable (global_State *g, Table *h) {
254 for (i = 0; i < h->sizearray; i++) 254 for (i = 0; i < h->sizearray; i++)
255 checkvalref(g, hgc, &h->array[i]); 255 checkvalref(g, hgc, &h->array[i]);
256 for (n = gnode(h, 0); n < limit; n++) { 256 for (n = gnode(h, 0); n < limit; n++) {
257 if (!ttisnil(gval(n))) { 257 if (!isempty(gval(n))) {
258 TValue k; 258 TValue k;
259 getnodekey(g->mainthread, &k, n); 259 getnodekey(g->mainthread, &k, n);
260 lua_assert(!keyisnil(n)); 260 lua_assert(!keyisnil(n));
@@ -842,7 +842,7 @@ static int table_query (lua_State *L) {
842 else if ((i -= t->sizearray) < sizenode(t)) { 842 else if ((i -= t->sizearray) < sizenode(t)) {
843 TValue k; 843 TValue k;
844 getnodekey(L, &k, gnode(t, i)); 844 getnodekey(L, &k, gnode(t, i));
845 if (!ttisnil(gval(gnode(t, i))) || 845 if (!isempty(gval(gnode(t, i))) ||
846 ttisnil(&k) || 846 ttisnil(&k) ||
847 ttisnumber(&k)) { 847 ttisnumber(&k)) {
848 pushobject(L, &k); 848 pushobject(L, &k);