diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index 6587ad3e0..77c18817d 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -89,9 +89,9 @@ template struct ei_product_mode ? DiagonalProduct : (Rhs::Flags & Lhs::Flags & SparseBit) ? SparseProduct - : Lhs::MaxColsAtCompileTime >= EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD - && ( Lhs::MaxRowsAtCompileTime >= EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD - || Rhs::MaxColsAtCompileTime >= EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD ) + : Lhs::MaxColsAtCompileTime == Dynamic + && ( Lhs::MaxRowsAtCompileTime == Dynamic + || Rhs::MaxColsAtCompileTime == Dynamic ) && (!(Rhs::IsVectorAtCompileTime && (Lhs::Flags&RowMajorBit) && (!(Lhs::Flags&DirectAccessBit)))) && (!(Lhs::IsVectorAtCompileTime && (!(Rhs::Flags&RowMajorBit)) && (!(Rhs::Flags&DirectAccessBit)))) && (ei_is_same_type::ret) diff --git a/test/nomalloc.cpp b/test/nomalloc.cpp index c1683206d..be4c35c48 100644 --- a/test/nomalloc.cpp +++ b/test/nomalloc.cpp @@ -25,8 +25,11 @@ // this hack is needed to make this file compiles with -pedantic (gcc) #define throw(X) -// discard vectorization since operator new is not called in that case +// discard vectorization since the global operator new is not called in that case #define EIGEN_DONT_VECTORIZE 1 +// discard stack allocation as that too bypasses the global operator new +#define EIGEN_STACK_ALLOCATION_LIMIT 0 + #include "main.h" void* operator new[] (size_t n) @@ -84,4 +87,5 @@ void test_nomalloc() VERIFY_RAISES_ASSERT(MatrixXd dummy = MatrixXd::Random(3,3)); CALL_SUBTEST( nomalloc(Matrix()) ); CALL_SUBTEST( nomalloc(Matrix4d()) ); + CALL_SUBTEST( nomalloc(Matrix()) ); }