Skip to content
Commit 789df06f authored by David Blaikie's avatar David Blaikie
Browse files

Ensure SmallVector::insert doesn't overwrite the last element in the range...

Ensure SmallVector::insert doesn't overwrite the last element in the range with the already-moved-from value

This would cause the last element in a range to be in a moved-from state
after an insert at a non-end position, losing that value entirely in the
process.

Side note: move_backward is subtle. It copies [A, B) to C-1 and down.
(the fact that it decrements both the second and third iterators before
the first movement is the subtle part... kind of surprising, anyway)

llvm-svn: 210426
parent 8804e5cb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment