summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/Archive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/Archive.cpp')
-rw-r--r--llvm/lib/Object/Archive.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp
index 9c8e3dbe2bd..8a3b34b0158 100644
--- a/llvm/lib/Object/Archive.cpp
+++ b/llvm/lib/Object/Archive.cpp
@@ -245,7 +245,10 @@ Archive::Child::getAsBinary(LLVMContext *Context) const {
if (std::error_code EC = BuffOrErr.getError())
return EC;
- return createBinary(BuffOrErr.get(), Context);
+ auto BinaryOrErr = createBinary(BuffOrErr.get(), Context);
+ if (BinaryOrErr)
+ return std::move(*BinaryOrErr);
+ return errorToErrorCode(BinaryOrErr.takeError());
}
ErrorOr<std::unique_ptr<Archive>> Archive::create(MemoryBufferRef Source) {
OpenPOWER on IntegriCloud