bug #1376: add missing assertion on size mismatch with compound assignment operators (e.g., mat += mat.col(j))

This commit is contained in:
Gael Guennebaud
2017-01-23 22:06:08 +01:00
parent b0db4eff36
commit ba3f977946
6 changed files with 57 additions and 10 deletions

View File

@@ -143,10 +143,7 @@ struct Assignment<DstXprType, SrcXprType, Functor, Sparse2Dense>
dst.setZero();
internal::evaluator<SrcXprType> srcEval(src);
Index dstRows = src.rows();
Index dstCols = src.cols();
if((dst.rows()!=dstRows) || (dst.cols()!=dstCols))
dst.resize(dstRows, dstCols);
resize_if_allowed(dst, src, func);
internal::evaluator<DstXprType> dstEval(dst);
const Index outerEvaluationSize = (internal::evaluator<SrcXprType>::Flags&RowMajorBit) ? src.rows() : src.cols();