mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
Fix for PR3946, in which SmallVector could behave strangely in corner cases.
Patch by Peter Johnson. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69785 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
41b1a489f5
commit
747972914a
@ -302,7 +302,7 @@ public:
|
||||
append(End-NumToInsert, End);
|
||||
|
||||
// Copy the existing elements that get replaced.
|
||||
std::copy(I, OldEnd-NumToInsert, I+NumToInsert);
|
||||
std::copy_backward(I, OldEnd-NumToInsert, OldEnd);
|
||||
|
||||
std::fill_n(I, NumToInsert, Elt);
|
||||
return I;
|
||||
@ -351,7 +351,7 @@ public:
|
||||
append(End-NumToInsert, End);
|
||||
|
||||
// Copy the existing elements that get replaced.
|
||||
std::copy(I, OldEnd-NumToInsert, I+NumToInsert);
|
||||
std::copy_backward(I, OldEnd-NumToInsert, OldEnd);
|
||||
|
||||
std::copy(From, To, I);
|
||||
return I;
|
||||
|
Loading…
x
Reference in New Issue
Block a user