aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Eigen/src/Core/Map.h2
-rw-r--r--test/dontalign.cpp5
2 files changed, 6 insertions, 1 deletions
diff --git a/Eigen/src/Core/Map.h b/Eigen/src/Core/Map.h
index b40bc2a50..692d0a179 100644
--- a/Eigen/src/Core/Map.h
+++ b/Eigen/src/Core/Map.h
@@ -95,7 +95,7 @@ struct traits<Map<PlainObjectType, MapOptions, StrideType> >
HasNoInnerStride = InnerStrideAtCompileTime == 1,
HasNoOuterStride = StrideType::OuterStrideAtCompileTime == 0,
HasNoStride = HasNoInnerStride && HasNoOuterStride,
- IsAligned = int(int(MapOptions)&Aligned)==Aligned,
+ IsAligned = bool(EIGEN_ALIGN) && ((int(MapOptions)&Aligned)==Aligned),
IsDynamicSize = PlainObjectType::SizeAtCompileTime==Dynamic,
KeepsPacketAccess = bool(HasNoInnerStride)
&& ( bool(IsDynamicSize)
diff --git a/test/dontalign.cpp b/test/dontalign.cpp
index 6ef2761bf..57ed4736b 100644
--- a/test/dontalign.cpp
+++ b/test/dontalign.cpp
@@ -53,6 +53,11 @@ void dontalign(const MatrixType& m)
v = square * v;
v = a.adjoint() * v;
VERIFY(square.determinant() != Scalar(0));
+
+ // bug 219: MapAligned() was giving an assert with EIGEN_DONT_ALIGN, because Map Flags were miscomputed
+ Scalar* array = internal::aligned_new<Scalar>(rows);
+ v = VectorType::MapAligned(array, rows);
+ internal::aligned_delete(array, rows);
}
void test_dontalign()