aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-11-06 15:07:12 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-11-06 15:07:12 -0200
commit49a67c6d3f608460f3f59da7972022fbe78b5844 (patch)
tree915e14e5bda89268a749679c072548f927ef159b
parenta921d81033555e1c122834f0cd19bd8a17ac35c0 (diff)
downloadlua-49a67c6d3f608460f3f59da7972022fbe78b5844.tar.gz
lua-49a67c6d3f608460f3f59da7972022fbe78b5844.tar.bz2
lua-49a67c6d3f608460f3f59da7972022fbe78b5844.zip
new macro 'NILCONSTANT' to initialize nil constants
-rw-r--r--lobject.c4
-rw-r--r--ltable.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/lobject.c b/lobject.c
index 88fb0e9e..846d02a7 100644
--- a/lobject.c
+++ b/lobject.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.c,v 2.30 2009/05/27 17:11:27 roberto Exp roberto $ 2** $Id: lobject.c,v 2.31 2009/06/17 17:48:34 roberto Exp roberto $
3** Some generic functions over Lua objects 3** Some generic functions over Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -25,7 +25,7 @@
25 25
26 26
27 27
28const TValue luaO_nilobject_ = {{NULL}, LUA_TNIL}; 28const TValue luaO_nilobject_ = {NILCONSTANT};
29 29
30 30
31/* 31/*
diff --git a/ltable.c b/ltable.c
index 9b964156..6c9ccd36 100644
--- a/ltable.c
+++ b/ltable.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.c,v 2.42 2009/10/23 12:31:12 roberto Exp roberto $ 2** $Id: ltable.c,v 2.43 2009/11/05 17:43:54 roberto Exp roberto $
3** Lua tables (hash) 3** Lua tables (hash)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -72,8 +72,8 @@
72#define dummynode (&dummynode_) 72#define dummynode (&dummynode_)
73 73
74static const Node dummynode_ = { 74static const Node dummynode_ = {
75 {{NULL}, LUA_TNIL}, /* value */ 75 {NILCONSTANT}, /* value */
76 {{{NULL}, LUA_TNIL, NULL}} /* key */ 76 {{NILCONSTANT, NULL}} /* key */
77}; 77};
78 78
79 79
@@ -418,7 +418,7 @@ static TValue *newkey (lua_State *L, Table *t, const TValue *key) {
418 mp = n; 418 mp = n;
419 } 419 }
420 } 420 }
421 setnodekey(mp, key); 421 setobj2t(L, gkey(mp), key);
422 luaC_barriert(L, t, key); 422 luaC_barriert(L, t, key);
423 lua_assert(ttisnil(gval(mp))); 423 lua_assert(ttisnil(gval(mp)));
424 return gval(mp); 424 return gval(mp);