aboutsummaryrefslogtreecommitdiff
path: root/lvm.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-11-03 15:26:13 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-11-03 15:26:13 -0300
commit08a077d673b25cf1fbfe21794f240f4ff4999667 (patch)
tree77ae945c9a2680af23d5fa11c156482b35c14e04 /lvm.h
parent43c8e5bded052801f54a7439d18933b83570eb82 (diff)
downloadlua-08a077d673b25cf1fbfe21794f240f4ff4999667.tar.gz
lua-08a077d673b25cf1fbfe21794f240f4ff4999667.tar.bz2
lua-08a077d673b25cf1fbfe21794f240f4ff4999667.zip
Full implementation of new representation for arrays
Diffstat (limited to 'lvm.h')
-rw-r--r--lvm.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lvm.h b/lvm.h
index 32455fba..c74c81f8 100644
--- a/lvm.h
+++ b/lvm.h
@@ -90,7 +90,7 @@ typedef enum {
90 if (!ttistable(t)) aux = HNOTATABLE; \ 90 if (!ttistable(t)) aux = HNOTATABLE; \
91 else { Table *h = hvalue(t); lua_Unsigned u = l_castS2U(k); \ 91 else { Table *h = hvalue(t); lua_Unsigned u = l_castS2U(k); \
92 if ((u - 1u < h->alimit)) { \ 92 if ((u - 1u < h->alimit)) { \
93 int tag = *getArrTag(h,u); \ 93 int tag = *getArrTag(h,(u)-1u); \
94 if (tagisempty(tag)) aux = HNOTFOUND; \ 94 if (tagisempty(tag)) aux = HNOTFOUND; \
95 else { farr2val(h, u, tag, res); aux = HOK; }} \ 95 else { farr2val(h, u, tag, res); aux = HOK; }} \
96 else { aux = luaH_getint(h, u, res); }} 96 else { aux = luaH_getint(h, u, res); }}
@@ -103,7 +103,7 @@ typedef enum {
103 if (!ttistable(t)) aux = HNOTATABLE; \ 103 if (!ttistable(t)) aux = HNOTATABLE; \
104 else { Table *h = hvalue(t); lua_Unsigned u = l_castS2U(k); \ 104 else { Table *h = hvalue(t); lua_Unsigned u = l_castS2U(k); \
105 if ((u - 1u < h->alimit)) { \ 105 if ((u - 1u < h->alimit)) { \
106 lu_byte *tag = getArrTag(h,u); \ 106 lu_byte *tag = getArrTag(h,(u)-1u); \
107 if (tagisempty(*tag)) aux = ~cast_int(u); \ 107 if (tagisempty(*tag)) aux = ~cast_int(u); \
108 else { fval2arr(h, u, tag, val); aux = HOK; }} \ 108 else { fval2arr(h, u, tag, val); aux = HOK; }} \
109 else { aux = luaH_psetint(h, u, val); }} 109 else { aux = luaH_psetint(h, u, val); }}