Skip to content

Commit

Permalink
Fix a bug in the code of llvm-cxxdump in dumpArchive() when
Browse files Browse the repository at this point in the history
iterating over an archive with object and non-object members that
would cause an Abort because to was not calling consumeError()
when the code was wanting to ignore a non-object file.

Found by Justin Bogner!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284867 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
enderby committed Oct 21, 2016
1 parent aa9584a commit a9abde4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Binary file not shown.
5 changes: 5 additions & 0 deletions test/tools/llvm-cxxdump/trivial.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ RUN: | FileCheck %s --check-prefix=COFF-I386
RUN: llvm-cxxdump %p/Inputs/trivial.obj.elf-i386 \
RUN: | FileCheck %s --check-prefix=ELF-I386

RUN: llvm-cxxdump %p/Inputs/mixed-archive.coff-i386 \
RUN: | FileCheck %s --check-prefix=MIXEDARCOFF-I386

COFF-I386: ??_7S@@6B@[0]: ??_R4S@@6B@
COFF-I386-NEXT: ??_7S@@6B@[4]: ??_GS@@UAEPAXI@Z
COFF-I386-NEXT: ??_8S@@7B@[0]: -4
Expand Down Expand Up @@ -57,5 +60,7 @@ ELF-I386-NEXT: _ZTV1A[0]: 0
ELF-I386-NEXT: _ZTV1A[4]: _ZTI1A
ELF-I386-NEXT: _ZTV1A[8]: _ZN1A1fEv

MIXEDARCOFF-I386: ??_7S@@6B@[0]: ??_R4S@@6B@

RUN: not llvm-cxxdump %t.blah 2>&1 | FileCheck --check-prefix=ENOENT %s
ENOENT: {{.*}}.blah: {{[Nn]}}o such file or directory
2 changes: 1 addition & 1 deletion tools/llvm-cxxdump/llvm-cxxdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ static void dumpArchive(const Archive *Arc) {
OS.flush();
reportError(Arc->getFileName(), Buf);
}
ChildOrErr.takeError();
consumeError(ChildOrErr.takeError());
continue;
}

Expand Down

0 comments on commit a9abde4

Please sign in to comment.