aboutsummaryrefslogtreecommitdiff
path: root/lib/lua/src/lvm.c
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2018-05-30 16:30:44 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2018-05-30 16:30:44 +0200
commitddd03c38a418c9f2ed204bf4fa68fd1d5feac11f (patch)
tree37b5d8f02fe8f1de111a9d67b4c128edc9d656c5 /lib/lua/src/lvm.c
parente3e98f935687ba60512889a5ddc62010216aa331 (diff)
downloadminetest-ddd03c38a418c9f2ed204bf4fa68fd1d5feac11f.tar.gz
minetest-ddd03c38a418c9f2ed204bf4fa68fd1d5feac11f.tar.bz2
minetest-ddd03c38a418c9f2ed204bf4fa68fd1d5feac11f.zip
Update embedded Lua to 5.1.5 (#7387)
Diffstat (limited to 'lib/lua/src/lvm.c')
-rw-r--r--lib/lua/src/lvm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/lua/src/lvm.c b/lib/lua/src/lvm.c
index ee3256ab9..e0a0cd852 100644
--- a/lib/lua/src/lvm.c
+++ b/lib/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");
}