mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Avoid undefined behavior in array_cwise test due to signed integer overflow
This commit is contained in:
@@ -1851,7 +1851,6 @@ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet handle_nonint_nonint_errors(
|
||||
|
||||
const Packet x_has_signbit = pcmp_eq(por(pand(x, cst_neg_inf), cst_pos_inf), cst_neg_inf);
|
||||
const Packet x_is_neg = pandnot(x_has_signbit, abs_x_is_zero);
|
||||
const Packet x_is_neg_zero = pand(x_has_signbit, abs_x_is_zero);
|
||||
|
||||
if (exponent_is_nan) {
|
||||
return pselect(pandnot(abs_x_is_one, x_is_neg), cst_pos_one, cst_nan);
|
||||
|
||||
Reference in New Issue
Block a user