diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-12-30 14:53:38 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-12-30 14:53:38 -0300 |
commit | e3c83835e7b396ab7db538fb3b052f02d7807dee (patch) | |
tree | c6d577a9543e0938b09bc697e551eeed21b7019e | |
parent | bd1b87c5790c0c6fe23f76aa360e879922e1e738 (diff) | |
download | lua-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 | ||