summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/COFF/InputFiles.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index 8ff6b9ceb18..088092e8ae7 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -93,7 +93,9 @@ MemoryBufferRef ArchiveFile::getMember(const Archive::Symbol *Sym) {
void ObjectFile::parse() {
// Parse a memory buffer as a COFF file.
auto BinOrErr = createBinary(MB);
- error(BinOrErr, "Failed to parse object file");
+ if (!BinOrErr)
+ error(errorToErrorCode(BinOrErr.takeError()),
+ "Failed to parse object file");
std::unique_ptr<Binary> Bin = std::move(*BinOrErr);
if (auto *Obj = dyn_cast<COFFObjectFile>(Bin.get())) {
OpenPOWER on IntegriCloud