[Bug libstdc++/78389] New: list::merge and list::sort are not exception safe
rs2740 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Nov 16 22:43:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78389
Bug ID: 78389
Summary: list::merge and list::sort are not exception safe
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: rs2740 at gmail dot com
Target Milestone: ---
If a comparison throws in the middle of the loop,
- list::merge will have spliced some elements over without updating the size of
the lists.
- list::sort will destroy any elements that have been transferred into the
temporary lists.
The former leaves the lists in an invariant-broken state. The latter is
surprising at best.
More information about the Gcc-bugs
mailing list