Benoit Jacob  committed 286fed7

Fix bug #132

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).

  • Participants
  • Parent commits 3958e0f
  • Branches 2.0

Comments (0)

Files changed (1)

File Eigen/src/Core/Product.h

   typedef typename ei_traits<ProductType>::_RhsNested Rhs;
   enum {
       UseRhsDirectly = ((ei_packet_traits<Scalar>::size==1) || (Rhs::Flags&ActualPacketAccessBit))
+                     && (Rhs::Flags&DirectAccessBit)
                      && (!(Rhs::Flags & RowMajorBit)) };
   template<typename DestDerived>
   typedef typename ei_traits<ProductType>::_LhsNested Lhs;
   enum {
       UseLhsDirectly = ((ei_packet_traits<Scalar>::size==1) || (Lhs::Flags&ActualPacketAccessBit))
+                     && (Lhs::Flags&DirectAccessBit)
                      && (Lhs::Flags & RowMajorBit) };
   template<typename DestDerived>