diff options
| author | Mike Pall <mike> | 2026-05-25 01:26:26 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2026-05-25 01:26:26 +0200 |
| commit | c3b379bf50c8819c61daa3afd9f21d9ec5708bd5 (patch) | |
| tree | ee302f245c9748b88a594f1aeb29cb772959d721 | |
| parent | 86d414f5cae062b06998ec66b0696a47d4f6a0f0 (diff) | |
| download | luajit-c3b379bf50c8819c61daa3afd9f21d9ec5708bd5.tar.gz luajit-c3b379bf50c8819c61daa3afd9f21d9ec5708bd5.tar.bz2 luajit-c3b379bf50c8819c61daa3afd9f21d9ec5708bd5.zip | |
FFI: Prevent sanitizer warning in carith_ptr().
Reported by Sergey Bronnikov. #1459
| -rw-r--r-- | src/lj_carith.c | 2 |
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. */ |
