mirror of git://sourceware.org/git/glibc.git
math: Fix UB in flt-32 nearbyint
UBSAN: Undefined behaviour in ../sysdeps/ieee754/flt-32/s_nearbyintf.c:53:4 left shift of 1 by 31 cannot be represented in type 'int'
This commit is contained in:
parent
ae54df4654
commit
0a933c9bf7
|
|
@ -34,7 +34,8 @@ __nearbyintf (float x)
|
|||
-8.3886080000e+06, /* 0xcb000000 */
|
||||
};
|
||||
fenv_t env;
|
||||
int32_t i0, j0, sx;
|
||||
int32_t i0, j0;
|
||||
uint32_t sx;
|
||||
float w, t;
|
||||
GET_FLOAT_WORD (i0, x);
|
||||
sx = (i0 >> 31) & 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue