Fix division by zero UB in packet size logic.
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index edd154a..c4fa771 100644 --- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h +++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -2399,7 +2399,7 @@ // fails, drop down to the scalar path. constexpr bool kCanLoadSRhsQuad = (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) && (SwappedTraits::LhsProgress != 8 || SResPacketHalfSize == nr) && (SwappedTraits::LhsProgress != 16 || SResPacketQuarterSize == nr)) {