Opened 6 years ago
Closed 6 years ago
#884 closed defect (fixed)
VectorMutable += incorrect if lhs and rhs overlap
Reported by: | Peter | Owned by: | Peter |
---|---|---|---|
Priority: | major | Milestone: | yat 0.14.1 |
Component: | utility | Version: | trunk |
Keywords: | Cc: |
Description
If lhs and rhs overlap the operation+= may behave unexpectedly as the operation is performed element by element
VectorMutable::operator+=(const VectorBase&)
same problem for operator-=
Change History (4)
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
Milestone: | yat 0.x+ → yat 0.14.1 |
---|---|
Owner: | changed from Jari Häkkinen to Peter |
Status: | new → assigned |
comment:4 Changed 6 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Element-by-element operations in VectorMutable? such as operator+=, operator-=, mul, and div did not work, when underlying data structure of lhs and rhs overlap such that elements in rhs are affected by the operation on lhs before they have been used on rhs. The fix is to use a temporary Vector when there is risk for overlap.
Note: See
TracTickets for help on using
tickets.
(In [3612]) test for refs #884