From 41f1cc67b8e55469367416151d6a82e3632cfda8 Mon Sep 17 00:00:00 2001 From: Christoph Hertzberg Date: Fri, 17 Aug 2018 16:42:53 +0200 Subject: Assertion depended on a not yet initialized value --- Eigen/src/Core/MapBase.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Eigen/src/Core/MapBase.h') diff --git a/Eigen/src/Core/MapBase.h b/Eigen/src/Core/MapBase.h index 020f939ad..668922ffc 100644 --- a/Eigen/src/Core/MapBase.h +++ b/Eigen/src/Core/MapBase.h @@ -43,6 +43,7 @@ template class MapBase enum { RowsAtCompileTime = internal::traits::RowsAtCompileTime, ColsAtCompileTime = internal::traits::ColsAtCompileTime, + InnerStrideAtCompileTime = internal::traits::InnerStrideAtCompileTime, SizeAtCompileTime = Base::SizeAtCompileTime }; @@ -187,8 +188,11 @@ template class MapBase void checkSanity(typename internal::enable_if<(internal::traits::Alignment>0),void*>::type = 0) const { #if EIGEN_MAX_ALIGN_BYTES>0 + // innerStride() is not set yet when this function is called, so we optimistically assume the lowest plausible value: + const Index minInnerStride = InnerStrideAtCompileTime == Dynamic ? 1 : Index(InnerStrideAtCompileTime); + EIGEN_ONLY_USED_FOR_DEBUG(minInnerStride); eigen_assert(( ((internal::UIntPtr(m_data) % internal::traits::Alignment) == 0) - || (cols() * rows() * innerStride() * sizeof(Scalar)) < internal::traits::Alignment ) && "data is not aligned"); + || (cols() * rows() * minInnerStride * sizeof(Scalar)) < internal::traits::Alignment ) && "data is not aligned"); #endif } -- cgit v1.2.3