[llvm-commits] [llvm] r69785 - /llvm/trunk/include/llvm/ADT/SmallVector.h
Owen Anderson
resistor at mac.com
Wed Apr 22 00:16:55 PDT 2009
Author: resistor
Date: Wed Apr 22 02:16:54 2009
New Revision: 69785
URL: http://llvm.org/viewvc/llvm-project?rev=69785&view=rev
Log:
Fix for PR3946, in which SmallVector could behave strangely in corner cases.
Patch by Peter Johnson.
Modified:
llvm/trunk/include/llvm/ADT/SmallVector.h
Modified: llvm/trunk/include/llvm/ADT/SmallVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallVector.h?rev=69785&r1=69784&r2=69785&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SmallVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SmallVector.h Wed Apr 22 02:16:54 2009
@@ -302,7 +302,7 @@
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 @@
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;
More information about the llvm-commits
mailing list