From 154f00e9eacaec5667215784c7601b55024e2f61 Mon Sep 17 00:00:00 2001 From: Antonio Sanchez Date: Thu, 1 Jul 2021 13:41:04 -0700 Subject: Fix inverse nullptr/asan errors for LU. For empty or single-column matrices, the current `PartialPivLU` currently dereferences a `nullptr` or accesses memory out-of-bounds. Here we adjust the checks to avoid this. --- test/inverse.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/inverse.cpp') diff --git a/test/inverse.cpp b/test/inverse.cpp index 99f9e0c9b..9cedfa1e1 100644 --- a/test/inverse.cpp +++ b/test/inverse.cpp @@ -135,6 +135,8 @@ EIGEN_DECLARE_TEST(inverse) CALL_SUBTEST_5( inverse(MatrixXf(s,s)) ); TEST_SET_BUT_UNUSED_VARIABLE(s) CALL_SUBTEST_5( inverse_zerosized() ); + CALL_SUBTEST_5( inverse(MatrixXf(0, 0)) ); + CALL_SUBTEST_5( inverse(MatrixXf(1, 1)) ); s = internal::random(25,100); CALL_SUBTEST_6( inverse(MatrixXcd(s,s)) ); -- cgit v1.2.3