This is an archive of the discontinued LLVM Phabricator instance.

std::set_union accesses values after move.
ClosedPublic

Authored by dyaroshev on Oct 29 2017, 8:52 AM.

Details

Summary

It's not ok to compare after assignment, it should be comare first and then assignment.

bug: https://bugs.llvm.org/show_bug.cgi?id=35119

Diff Detail

Event Timeline

dyaroshev created this revision.Oct 29 2017, 8:52 AM
dyaroshev updated this revision to Diff 120749.Oct 29 2017, 8:59 AM

I forgot the synopsis.

mclow.lists edited edge metadata.Oct 29 2017, 7:57 PM

If you start playing with move_iterators, I suspect you'll find several of the algorithms don't work quite right.

This looks good to me.

In general, you should add cfe-commits as a subscriber to any libc++ patch you propose.

mclow.lists added a subscriber: cfe-commits.
dyaroshev edited the summary of this revision. (Show Details)Oct 29 2017, 11:26 PM
mclow.lists accepted this revision.Oct 30 2017, 8:51 AM

Committed as revision 316914. Thanks!

This revision is now accepted and ready to land.Oct 30 2017, 8:51 AM
mclow.lists closed this revision.Oct 30 2017, 8:51 AM
EricWF edited edge metadata.Oct 30 2017, 11:04 AM

We should backport this, right @mclow.lists?