math: Fix UB in ldbl-128 roundl

$ math/test-float128-cospi
testing _Float128 (without inline functions)
UBSAN: Undefined behaviour in ../sysdeps/ieee754/float128/../ldbl-128/s_roundl.c:75:30 left shift of 1 by 63 cannot be represented in type 'long long int'
This commit is contained in:
Adhemerval Zanella 2025-05-05 10:45:15 -03:00
parent 9dc7be063e
commit c1ffff3c53
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ __roundl (_Float128 x)
/* X is integral. */
return x;
uint64_t j = i1 + (1LL << (111 - j0));
uint64_t j = i1 + (1ULL << (111 - j0));
if (j < i1)
i0 += 1;
i1 = j;