aboutsummaryrefslogtreecommitdiff
path: root/ltable.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltable.c')
-rw-r--r--ltable.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ltable.c b/ltable.c
index a234bebb..543c34df 100644
--- a/ltable.c
+++ b/ltable.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.c,v 2.91 2014/06/26 16:17:35 roberto Exp roberto $ 2** $Id: ltable.c,v 2.92 2014/07/18 13:36:14 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*/
@@ -309,7 +309,7 @@ static void setnodevector (lua_State *L, Table *t, int size) {
309 for (i=0; i<size; i++) { 309 for (i=0; i<size; i++) {
310 Node *n = gnode(t, i); 310 Node *n = gnode(t, i);
311 gnext(n) = 0; 311 gnext(n) = 0;
312 setnilvalue(gkey(n)); 312 setnilvalue(wgkey(n));
313 setnilvalue(gval(n)); 313 setnilvalue(gval(n));
314 } 314 }
315 } 315 }
@@ -466,7 +466,7 @@ TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key) {
466 mp = f; 466 mp = f;
467 } 467 }
468 } 468 }
469 setobj2t(L, gkey(mp), key); 469 setkey(L, &mp->i_key, key);
470 luaC_barrierback(L, t, key); 470 luaC_barrierback(L, t, key);
471 lua_assert(ttisnil(gval(mp))); 471 lua_assert(ttisnil(gval(mp)));
472 return gval(mp); 472 return gval(mp);
@@ -503,7 +503,8 @@ const TValue *luaH_getstr (Table *t, TString *key) {
503 Node *n = hashstr(t, key); 503 Node *n = hashstr(t, key);
504 lua_assert(key->tt == LUA_TSHRSTR); 504 lua_assert(key->tt == LUA_TSHRSTR);
505 for (;;) { /* check whether `key' is somewhere in the chain */ 505 for (;;) { /* check whether `key' is somewhere in the chain */
506 if (ttisshrstring(gkey(n)) && eqshrstr(tsvalue(gkey(n)), key)) 506 const TValue *k = gkey(n);
507 if (ttisshrstring(k) && eqshrstr(tsvalue(k), key))
507 return gval(n); /* that's it */ 508 return gval(n); /* that's it */
508 else { 509 else {
509 int nx = gnext(n); 510 int nx = gnext(n);