math: Fix UB on lroundl

Building with --enable-ubasn triggers:

$ math/test-ldouble-pow
testing long double (without inline functions)
UBSAN: Undefined behaviour in ../sysdeps/ieee754/ldbl-96/s_roundl.c:75:28 left shift of 1 by 31 cannot be represented in type 'int'
Aborted
This commit is contained in:
Adhemerval Zanella 2025-05-02 14:59:13 -03:00
parent 51a2a92502
commit c949920ef6
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ __roundl (long double x)
/* X is integral. */
return x;
uint32_t j = i1 + (1 << (62 - j0));
uint32_t j = i1 + (1U << (62 - j0));
if (j < i1)
{
uint32_t k = i0 + 1;