summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-12-30 14:53:38 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-12-30 14:53:38 -0300
commite3c83835e7b396ab7db538fb3b052f02d7807dee (patch)
treec6d577a9543e0938b09bc697e551eeed21b7019e
parentbd1b87c5790c0c6fe23f76aa360e879922e1e738 (diff)
downloadlua-e3c83835e7b396ab7db538fb3b052f02d7807dee.tar.gz
lua-e3c83835e7b396ab7db538fb3b052f02d7807dee.tar.bz2
lua-e3c83835e7b396ab7db538fb3b052f02d7807dee.zip
Fixed bug in 'aux_rawset'
In 'aux_rawset', top must be decremented after the barrier, which refers to top-1. (Bug introduced in commit c646e57fd.)
-rw-r--r--lapi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lapi.c b/lapi.c
index b49d45c9..073baa4d 100644
--- a/lapi.c
+++ b/lapi.c
@@ -856,9 +856,9 @@ static void aux_rawset (lua_State *L, int idx, TValue *key, int n) {
856 t = gettable(L, idx); 856 t = gettable(L, idx);
857 slot = luaH_set(L, t, key); 857 slot = luaH_set(L, t, key);
858 setobj2t(L, slot, s2v(L->top - 1)); 858 setobj2t(L, slot, s2v(L->top - 1));
859 L->top -= n;
860 invalidateTMcache(t); 859 invalidateTMcache(t);
861 luaC_barrierback(L, obj2gco(t), s2v(L->top - 1)); 860 luaC_barrierback(L, obj2gco(t), s2v(L->top - 1));
861 L->top -= n;
862 lua_unlock(L); 862 lua_unlock(L);
863} 863}
864 864