diff options
Diffstat (limited to 'llvm/lib/Object/Binary.cpp')
-rw-r--r-- | llvm/lib/Object/Binary.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Object/Binary.cpp b/llvm/lib/Object/Binary.cpp index 201899ffe2e..a1497708c1e 100644 --- a/llvm/lib/Object/Binary.cpp +++ b/llvm/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; } |