Fix another UB access.

This commit is contained in:
Antonio Sánchez 2023-07-31 19:18:45 +00:00 committed by Rasmus Munk Larsen
parent 5527e78a64
commit 0cef325b07
2 changed files with 6 additions and 1 deletions

View File

@ -97,6 +97,11 @@ struct triangular_solver_selector<Lhs,Rhs,Side,Mode,NoUnrolling,Dynamic>
typedef internal::gemm_blocking_space<(Rhs::Flags&RowMajorBit) ? RowMajor : ColMajor,Scalar,Scalar, typedef internal::gemm_blocking_space<(Rhs::Flags&RowMajorBit) ? RowMajor : ColMajor,Scalar,Scalar,
Rhs::MaxRowsAtCompileTime, Rhs::MaxColsAtCompileTime, Lhs::MaxRowsAtCompileTime,4> BlockingType; Rhs::MaxRowsAtCompileTime, Rhs::MaxColsAtCompileTime, Lhs::MaxRowsAtCompileTime,4> BlockingType;
// Nothing to solve.
if (actualLhs.size() == 0 || rhs.size() == 0) {
return;
}
BlockingType blocking(rhs.rows(), rhs.cols(), size, 1, false); BlockingType blocking(rhs.rows(), rhs.cols(), size, 1, false);
triangular_solve_matrix<Scalar,Index,Side,Mode,LhsProductTraits::NeedToConjugate,(int(Lhs::Flags) & RowMajorBit) ? RowMajor : ColMajor, triangular_solve_matrix<Scalar,Index,Side,Mode,LhsProductTraits::NeedToConjugate,(int(Lhs::Flags) & RowMajorBit) ? RowMajor : ColMajor,

View File

@ -424,7 +424,7 @@ struct triangular_product_impl<Mode,LhsIsTriangular,Lhs,false,Rhs,false>
// Empty product, return early. Otherwise, we get `nullptr` use errors below when we try to access // Empty product, return early. Otherwise, we get `nullptr` use errors below when we try to access
// coeffRef(0,0). // coeffRef(0,0).
if (a_lhs.size() == 0 || a_rhs.size() == 0) { if (lhs.size() == 0 || rhs.size() == 0) {
return; return;
} }