From: Adhemerval Zanella Date: Mon, 5 May 2025 13:37:35 +0000 (-0300) Subject: math: Fix UB in ldbl-128 rintl X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae41adf241a6970ba7afa5480884a4356cfb40df;p=thirdparty%2Fglibc.git math: Fix UB in ldbl-128 rintl UBSAN: Undefined behaviour in ../sysdeps/ieee754/float128/../ldbl-128/s_rintl.c:60:4 left shift of 1 by 63 cannot be represented in type 'long int' --- diff --git a/sysdeps/ieee754/ldbl-128/s_rintl.c b/sysdeps/ieee754/ldbl-128/s_rintl.c index 072ed8ec15..9236105a2a 100644 --- a/sysdeps/ieee754/ldbl-128/s_rintl.c +++ b/sysdeps/ieee754/ldbl-128/s_rintl.c @@ -44,7 +44,8 @@ __rintl (_Float128 x) 5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */ -5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */ }; - int64_t i0, j0, sx; + int64_t i0, j0; + uint64_t sx; uint64_t i1 __attribute__ ((unused)); _Float128 w, t; GET_LDOUBLE_WORDS64 (i0, i1, x);