math: Fix UB on dbl-64 rint

UBSAN: Undefined behaviour in ../sysdeps/ieee754/dbl-64/s_rint.c:53:4 left shift of 1 by 63 cannot be represented in type 'long long int'
This commit is contained in:
Adhemerval Zanella 2025-05-06 13:38:31 +00:00
parent 48557d36a0
commit ae54df4654
1 changed files with 2 additions and 1 deletions

View File

@ -37,7 +37,8 @@ __rint (double x)
4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
-4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */
};
int64_t i0, sx;
int64_t i0;
uint64_t sx;
int32_t j0;
EXTRACT_WORDS64 (i0, x);
sx = (i0 >> 63) & 1;