From 391094c50743f28f9174f455661f650bf07e0177 Mon Sep 17 00:00:00 2001 From: Niall Murphy Date: Mon, 10 May 2021 11:43:49 +0100 Subject: Use derived object type in conservative_resize_like_impl When calling conservativeResize() on a matrix with DontAlign flag, the temporary variable used to perform the resize should have the same Options as the original matrix to ensure that the correct override of swap is called (i.e. PlainObjectBase::swap(DenseBase & other). Calling the base class swap (i.e in DenseBase) results in assertions errors or memory corruption. --- test/conservative_resize.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/conservative_resize.cpp b/test/conservative_resize.cpp index 5dc500068..d709e3346 100644 --- a/test/conservative_resize.cpp +++ b/test/conservative_resize.cpp @@ -148,6 +148,7 @@ EIGEN_DECLARE_TEST(conservative_resize) CALL_SUBTEST_4((run_matrix_tests, Eigen::ColMajor>())); CALL_SUBTEST_5((run_matrix_tests, Eigen::RowMajor>())); CALL_SUBTEST_5((run_matrix_tests, Eigen::ColMajor>())); + CALL_SUBTEST_1((run_matrix_tests())); CALL_SUBTEST_1((run_vector_tests())); CALL_SUBTEST_2((run_vector_tests())); -- cgit v1.2.3