From 352961a7ebc2a83c9b15e76a904cf272bf3ee72d Mon Sep 17 00:00:00 2001 From: dzaima Date: Tue, 2 May 2023 10:47:13 +0300 Subject: [PATCH] another ubsan complaint --- src/builtins/arithd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builtins/arithd.c b/src/builtins/arithd.c index ccb97a04..9a27f367 100644 --- a/src/builtins/arithd.c +++ b/src/builtins/arithd.c @@ -191,7 +191,7 @@ static B modint_AS(B w, B xv) { return modint_AA(w, C2(shape, C1(fne, incG(w)) if (xe==el_bit) return x; // if n>1 (true from the above), 0‿1 ≡ (2⋆n)|0‿1 u8 elw = elWidth(xe); u32 mask0 = (u32)wi32; - if (mask0 > (1 << (elw*8-1))) { + if (mask0 > ((u32)1 << (elw*8-1))) { if (mask0 > 32768) { x=taga(cpyI32Arr(x)); xe=el_i32; elw=4; } else if (mask0 > 128) { x=taga(cpyI16Arr(x)); xe=el_i16; elw=2; } else UD;