Opened 9 years ago
Last modified 9 years ago
#9067 new Bugs
rational::assign doesn't even have the basic guarantee
Reported by: | Daryle Walker | Owned by: | Daryle Walker |
---|---|---|---|
Milestone: | To Be Determined | Component: | rational |
Version: | Boost 1.54.0 | Severity: | Problem |
Keywords: | Cc: |
Description
The current implementation of the assign
member function assigns the new components before normalization checks. Normalization throws if the components are too violating to fix, but the object has already been changed and the old values have been lost. Worse, if the object was created outside of the current stack frame, it will survive the exception in a state still violating its invariant!
Note:
See TracTickets
for help on using tickets.
(In [85526]) Fixed normalization problem with Boost.Rational's "assign"; add check for negative values too large for normalization (refs #9067)