summaryrefslogtreecommitdiff
path: root/deps/lua/src/lvm.c
diff options
context:
space:
mode:
authorYossi Gottlieb <yossigo@gmail.com>2013-06-23 08:59:01 +0300
committerYossi Gottlieb <yossigo@gmail.com>2013-06-23 08:59:01 +0300
commita9a29ff16effa0d36a16c0859c3dadb4ab87889a (patch)
tree89e376da1560d6fb16b20d1b570d9a53017458be /deps/lua/src/lvm.c
parent9cc3257e94cdbea94ea259f834409a221f121da4 (diff)
parent16ddbb7dfc435f1abb01ecd4df316827be341899 (diff)
downloadredis-2.6.14-1.tar.gz
Merge upstream 2.6.14.2.6.14-1
Diffstat (limited to 'deps/lua/src/lvm.c')
-rw-r--r--deps/lua/src/lvm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/deps/lua/src/lvm.c b/deps/lua/src/lvm.c
index ee3256ab9..e0a0cd852 100644
--- a/deps/lua/src/lvm.c
+++ b/deps/lua/src/lvm.c
@@ -1,5 +1,5 @@
/*
-** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $
+** $Id: lvm.c,v 2.63.1.5 2011/08/17 20:43:11 roberto Exp $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -133,6 +133,7 @@ void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) {
void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
int loop;
+ TValue temp;
for (loop = 0; loop < MAXTAGLOOP; loop++) {
const TValue *tm;
if (ttistable(t)) { /* `t' is a table? */
@@ -141,6 +142,7 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
if (!ttisnil(oldval) || /* result is no nil? */
(tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */
setobj2t(L, oldval, val);
+ h->flags = 0;
luaC_barriert(L, h, val);
return;
}
@@ -152,7 +154,9 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
callTM(L, tm, t, key, val);
return;
}
- t = tm; /* else repeat with `tm' */
+ /* else repeat with `tm' */
+ setobj(L, &temp, tm); /* avoid pointing inside table (may rehash) */
+ t = &temp;
}
luaG_runerror(L, "loop in settable");
}