Fix a bug in the code of llvm-cxxdump in dumpArchive() when

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!

llvm-svn: 284867
This commit is contained in:
Kevin Enderby 2016-10-21 20:03:14 +00:00
parent 42909a6f3a
commit 2f9d8d0702
3 changed files with 6 additions and 1 deletions

View File

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

View File

@ -502,7 +502,7 @@ static void dumpArchive(const Archive *Arc) {
OS.flush();
reportError(Arc->getFileName(), Buf);
}
ChildOrErr.takeError();
consumeError(ChildOrErr.takeError());
continue;
}