diff options
author | Antonio Sanchez <cantonios@google.com> | 2021-07-01 13:41:04 -0700 |
---|---|---|
committer | Antonio Sanchez <cantonios@google.com> | 2021-07-01 13:41:04 -0700 |
commit | 154f00e9eacaec5667215784c7601b55024e2f61 (patch) | |
tree | f17d88a4084f103aac544f0799b60bd16f9cca6d /test/inverse.cpp | |
parent | eb047759030558acf0764d5d2f913f4f84cf85a8 (diff) |
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.
Diffstat (limited to 'test/inverse.cpp')
-rw-r--r-- | test/inverse.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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<float>() ); + CALL_SUBTEST_5( inverse(MatrixXf(0, 0)) ); + CALL_SUBTEST_5( inverse(MatrixXf(1, 1)) ); s = internal::random<int>(25,100); CALL_SUBTEST_6( inverse(MatrixXcd(s,s)) ); |