mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-10 18:59:01 +08:00
Fix division by zero UB in packet size logic.
This commit is contained in:
parent
186f8205db
commit
9229cfa822
@ -2399,7 +2399,7 @@ EIGEN_DONT_INLINE void gebp_kernel<LhsScalar, RhsScalar, Index, DataMapper, mr,
|
|||||||
// fails, drop down to the scalar path.
|
// fails, drop down to the scalar path.
|
||||||
constexpr bool kCanLoadSRhsQuad =
|
constexpr bool kCanLoadSRhsQuad =
|
||||||
(unpacket_traits<SLhsPacket>::size < 4) ||
|
(unpacket_traits<SLhsPacket>::size < 4) ||
|
||||||
(unpacket_traits<SRhsPacket>::size % (unpacket_traits<SLhsPacket>::size / 4)) == 0;
|
(unpacket_traits<SRhsPacket>::size % ((std::max<int>)(unpacket_traits<SLhsPacket>::size, 4) / 4)) == 0;
|
||||||
if (kCanLoadSRhsQuad && (SwappedTraits::LhsProgress % 4) == 0 && (SwappedTraits::LhsProgress <= 16) &&
|
if (kCanLoadSRhsQuad && (SwappedTraits::LhsProgress % 4) == 0 && (SwappedTraits::LhsProgress <= 16) &&
|
||||||
(SwappedTraits::LhsProgress != 8 || SResPacketHalfSize == nr) &&
|
(SwappedTraits::LhsProgress != 8 || SResPacketHalfSize == nr) &&
|
||||||
(SwappedTraits::LhsProgress != 16 || SResPacketQuarterSize == nr)) {
|
(SwappedTraits::LhsProgress != 16 || SResPacketQuarterSize == nr)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user