diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-21 12:58:07 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-21 12:58:07 +0000 |
commit | 02a1364bf8ede511ad603e5aa99ea7dbf11f0609 (patch) | |
tree | 33265609b4181b8869fa25d59a2c75ae211b30af /tools | |
parent | 5d3041f99d4a328afa104b3fb410a77faba68d09 (diff) | |
download | external_llvm-02a1364bf8ede511ad603e5aa99ea7dbf11f0609.zip external_llvm-02a1364bf8ede511ad603e5aa99ea7dbf11f0609.tar.gz external_llvm-02a1364bf8ede511ad603e5aa99ea7dbf11f0609.tar.bz2 |
Handle replacement into a position past the original member.
We were incorrectly computing where to insert a member if it was replacing
a previous member that was before the insert point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186792 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-ar/llvm-ar.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp index 4ade562..b1c8986 100644 --- a/tools/llvm-ar/llvm-ar.cpp +++ b/tools/llvm-ar/llvm-ar.cpp @@ -458,10 +458,10 @@ computeNewArchiveMembers(ArchiveOperation Operation, int InsertPos = -1; StringRef PosName = sys::path::filename(RelPos); if (OldArchive) { - int Pos = 0; for (object::Archive::child_iterator I = OldArchive->begin_children(), E = OldArchive->end_children(); - I != E; ++I, ++Pos) { + I != E; ++I) { + int Pos = Ret.size(); StringRef Name; failIfError(I->getName(Name)); if (Name == PosName) { |