aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-06-10 12:09:35 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-06-10 12:09:35 -0300
commit94b503d95ef00f1e38b58b024ef45bf8973a8746 (patch)
treec713558a386934bc1d251f064c8d9fae1fb725c0 /lvm.c
parentbdc85357aa41a9610498232c2cffe7aa191e5cf6 (diff)
downloadlua-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lvm.c b/lvm.c
index 88f8fe27..7ee5f6bc 100644
--- a/lvm.c
+++ b/lvm.c
@@ -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 }