mirror of git://sourceware.org/git/glibc.git
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:
parent
48557d36a0
commit
ae54df4654
|
|
@ -37,7 +37,8 @@ __rint (double x)
|
||||||
4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
|
4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
|
||||||
-4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */
|
-4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */
|
||||||
};
|
};
|
||||||
int64_t i0, sx;
|
int64_t i0;
|
||||||
|
uint64_t sx;
|
||||||
int32_t j0;
|
int32_t j0;
|
||||||
EXTRACT_WORDS64 (i0, x);
|
EXTRACT_WORDS64 (i0, x);
|
||||||
sx = (i0 >> 63) & 1;
|
sx = (i0 >> 63) & 1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue