aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/ADT/SmallVector.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h
index d5fef4828e..bf4960ad14 100644
--- a/include/llvm/ADT/SmallVector.h
+++ b/include/llvm/ADT/SmallVector.h
@@ -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;