diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-06-10 12:09:35 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-06-10 12:09:35 -0300 |
commit | 94b503d95ef00f1e38b58b024ef45bf8973a8746 (patch) | |
tree | c713558a386934bc1d251f064c8d9fae1fb725c0 /lvm.c | |
parent | bdc85357aa41a9610498232c2cffe7aa191e5cf6 (diff) | |
download | lua-94b503d95ef00f1e38b58b024ef45bf8973a8746.tar.gz lua-94b503d95ef00f1e38b58b024ef45bf8973a8746.tar.bz2 lua-94b503d95ef00f1e38b58b024ef45bf8973a8746.zip |
Encoding of table indices (hres) must use C indices
As the encoding of array indices is (~index), 0 is encoded as -1 and
INT_MAX is encoded as INT_MIN.
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1857,7 +1857,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { | |||
1857 | luaH_resizearray(L, h, last); /* preallocate it at once */ | 1857 | luaH_resizearray(L, h, last); /* preallocate it at once */ |
1858 | for (; n > 0; n--) { | 1858 | for (; n > 0; n--) { |
1859 | TValue *val = s2v(ra + n); | 1859 | TValue *val = s2v(ra + n); |
1860 | obj2arr(h, last, val); | 1860 | obj2arr(h, last - 1, val); |
1861 | last--; | 1861 | last--; |
1862 | luaC_barrierback(L, obj2gco(h), val); | 1862 | luaC_barrierback(L, obj2gco(h), val); |
1863 | } | 1863 | } |