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
This commit is contained in:
Rafael Espindola
2013-07-21 12:58:07 +00:00
parent 5d3041f99d
commit 02a1364bf8
2 changed files with 15 additions and 2 deletions

View File

@ -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) {