aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2026-05-25 01:26:26 +0200
committerMike Pall <mike>2026-05-25 01:26:26 +0200
commitc3b379bf50c8819c61daa3afd9f21d9ec5708bd5 (patch)
treeee302f245c9748b88a594f1aeb29cb772959d721 /src
parent86d414f5cae062b06998ec66b0696a47d4f6a0f0 (diff)
downloadluajit-c3b379bf50c8819c61daa3afd9f21d9ec5708bd5.tar.gz
luajit-c3b379bf50c8819c61daa3afd9f21d9ec5708bd5.tar.bz2
luajit-c3b379bf50c8819c61daa3afd9f21d9ec5708bd5.zip
FFI: Prevent sanitizer warning in carith_ptr().
Reported by Sergey Bronnikov. #1459
Diffstat (limited to 'src')
-rw-r--r--src/lj_carith.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lj_carith.c b/src/lj_carith.c
index e3287de9d..b1da0e2c3 100644
--- a/src/lj_carith.c
+++ b/src/lj_carith.c
@@ -133,7 +133,7 @@ static int carith_ptr(lua_State *L, CTState *cts, CDArith *ca, MMS mm)
133 return 0; 133 return 0;
134 lj_cconv_ct_ct(cts, ctype_get(cts, CTID_INT_PSZ), ca->ct[1], 134 lj_cconv_ct_ct(cts, ctype_get(cts, CTID_INT_PSZ), ca->ct[1],
135 (uint8_t *)&idx, ca->p[1], 0); 135 (uint8_t *)&idx, ca->p[1], 0);
136 if (mm == MM_sub) idx = -idx; 136 if (mm == MM_sub) idx = (ptrdiff_t)(~(uintptr_t)idx+1u);
137 } else if (mm == MM_add && ctype_isnum(ctp->info) && 137 } else if (mm == MM_add && ctype_isnum(ctp->info) &&
138 (ctype_isptr(ca->ct[1]->info) || ctype_isrefarray(ca->ct[1]->info))) { 138 (ctype_isptr(ca->ct[1]->info) || ctype_isrefarray(ca->ct[1]->info))) {
139 /* Swap pointer and index. */ 139 /* Swap pointer and index. */