Bug 415 - Return value of Rotation2D::operator*= is invalid.
Return value of Rotation2D::operator*= is invalid.
Status: RESOLVED FIXED
Product: Eigen
Classification: Unclassified
Component: Geometry
3.0
All All
: Normal Unknown
Assigned To: Nobody
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-06 16:50 UTC by Erik.Einhorn
Modified: 2012-02-08 21:53 UTC (History)
3 users (show)



Attachments

Description Erik.Einhorn 2012-02-06 16:50:38 UTC
Geometry/Rotation2D.h(92) contains the following code:

  inline Rotation2D& operator*=(const Rotation2D& other)
  { return m_angle += other.m_angle; return *this; }


There are two returns in this method. Probably the first one came by copy&pasting it from the operator*(). The code should be modified to:

  inline Rotation2D& operator*=(const Rotation2D& other)
  { m_angle += other.m_angle; return *this; }
Comment 1 Gael Guennebaud 2012-02-08 21:53:14 UTC
you're perfectly right, thanks for the report, just in time for 3.0.5....

https://bitbucket.org/eigen/eigen/changeset/da01029bc8eb/
changeset:   da01029bc8eb
date:        2012-02-08 21:50:51
summary:     fix bug 415: wrong return in Rotation2D::operator*=

https://bitbucket.org/eigen/eigen/changeset/f9e92ba25ad6/
changeset:   f9e92ba25ad6
branch:      3.0

Note You need to log in before you can comment on or make changes to this bug.