summaryrefslogtreecommitdiff
path: root/lib/Object/Binary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Object/Binary.cpp')
-rw-r--r--lib/Object/Binary.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Object/Binary.cpp b/lib/Object/Binary.cpp
index 201899ffe2..a1497708c1 100644
--- a/lib/Object/Binary.cpp
+++ b/lib/Object/Binary.cpp
@@ -84,8 +84,10 @@ error_code object::createBinary(MemoryBuffer *Source,
}
case sys::fs::file_magic::coff_object:
case sys::fs::file_magic::pecoff_executable: {
- OwningPtr<Binary> ret(new COFFObjectFile(scopedSource.take(), ec));
- if (ec) return ec;
+ OwningPtr<Binary> ret(
+ ObjectFile::createCOFFObjectFile(scopedSource.take()));
+ if (!ret)
+ return object_error::invalid_file_type;
Result.swap(ret);
return object_error::success;
}