[llvm-commits] [llvm] r69785 - /llvm/trunk/include/llvm/ADT/SmallVector.h
Bill Wendling
isanbard at gmail.com
Wed Apr 22 16:21:58 PDT 2009
Testcase?
-bw
On Wed, Apr 22, 2009 at 12:16 AM, Owen Anderson <resistor at mac.com> wrote:
> 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;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list