From b6bf3f2da62be4f3e3e17c335fcc87c7e2ab3abf Mon Sep 17 00:00:00 2001 From: dzaima Date: Wed, 26 Jun 2024 03:35:25 +0300 Subject: [PATCH] suppress clang ubsan warning it's a true warning of actual UB and could conceivably be taken advantage of by a compiler, but is not currently so keep things pretty for now --- src/builtins/scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builtins/scan.c b/src/builtins/scan.c index f86f2074..b0a462e4 100644 --- a/src/builtins/scan.c +++ b/src/builtins/scan.c @@ -414,7 +414,7 @@ B scan_rows_bit(u8 rtid, B x, usz m) { usz e = i + len; si_bcs8(xp + i/64, buf, len); memset(rp+i, -c, len); - i8* bi = buf-i; + i8* bi = buf; bi-=i; // yeah this makes the pointer go out of bounds, but whatever assert(j > i); if (mk) while (j+mk <= e) { storeu_u64(rp+j, loadu_u64(bi+j-1) & mm); j+=mk; } for (; j < e; j += m) rp[j] = bi[j-1];