mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
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.
This commit is contained in:
@@ -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)) );
|
||||
|
||||
Reference in New Issue
Block a user