In the matrix-vector products, we were calling coeffRef on the vector xpr without checking it has DirectAccess.

Will add unit test (since it's in 2.0, just import the test case provided in the bug report).

Confirming that this can't happen in the devel branch, and that if we tried to call coeffRef on an xpr
without DirectAccess, that would not compile (since the DenseCoeffsBase class was introduced).
This commit is contained in:
Benoit Jacob 2010-06-09 19:39:05 -04:00
parent c76c8d6917
commit 501063d9e9

View File

@ -636,6 +636,7 @@ struct ei_cache_friendly_product_selector<ProductType,LhsRows,RowMajor,HasDirect
typedef typename ei_traits<ProductType>::_RhsNested Rhs; typedef typename ei_traits<ProductType>::_RhsNested Rhs;
enum { enum {
UseRhsDirectly = ((ei_packet_traits<Scalar>::size==1) || (Rhs::Flags&ActualPacketAccessBit)) UseRhsDirectly = ((ei_packet_traits<Scalar>::size==1) || (Rhs::Flags&ActualPacketAccessBit))
&& (Rhs::Flags&DirectAccessBit)
&& (!(Rhs::Flags & RowMajorBit)) }; && (!(Rhs::Flags & RowMajorBit)) };
template<typename DestDerived> template<typename DestDerived>
@ -664,6 +665,7 @@ struct ei_cache_friendly_product_selector<ProductType,1,LhsOrder,LhsAccess,RhsCo
typedef typename ei_traits<ProductType>::_LhsNested Lhs; typedef typename ei_traits<ProductType>::_LhsNested Lhs;
enum { enum {
UseLhsDirectly = ((ei_packet_traits<Scalar>::size==1) || (Lhs::Flags&ActualPacketAccessBit)) UseLhsDirectly = ((ei_packet_traits<Scalar>::size==1) || (Lhs::Flags&ActualPacketAccessBit))
&& (Lhs::Flags&DirectAccessBit)
&& (Lhs::Flags & RowMajorBit) }; && (Lhs::Flags & RowMajorBit) };
template<typename DestDerived> template<typename DestDerived>