else if (Ident.second == ELF::ELFDATA2MSB)
R.reset(new ELFObjectFile<ELFType<support::big, false>>(Obj, EC));
else
- llvm_unreachable("Buffer is not an ELF object file!");
+ return object_error::parse_failed;
} else {
assert(Ident.first == ELF::ELFCLASS64);
if (Ident.second == ELF::ELFDATA2LSB)
else if (Ident.second == ELF::ELFDATA2MSB)
R.reset(new ELFObjectFile<ELFType<support::big, true>>(Obj, EC));
else
- llvm_unreachable("Buffer is not an ELF object file!");
+ return object_error::parse_failed;
}
if (EC)
; Verify that llvm-dwarfdump doesn't crash on broken input files.
RUN: llvm-dwarfdump %p/Inputs/invalid.elf 2>&1 | FileCheck %s --check-prefix=INVALID-ELF
+RUN: llvm-dwarfdump %p/Inputs/invalid.elf.2 2>&1 | FileCheck %s --check-prefix=INVALID-ELF
INVALID-ELF: Invalid data was encountered while parsing the file