summaryrefslogtreecommitdiff
path: root/tools/lto
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lto')
-rw-r--r--tools/lto/LTOCodeGenerator.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp
index ffe244dbcd..372cb31a4c 100644
--- a/tools/lto/LTOCodeGenerator.cpp
+++ b/tools/lto/LTOCodeGenerator.cpp
@@ -209,8 +209,11 @@ const void* LTOCodeGenerator::compile(size_t* length, std::string& errMsg)
// read .o file into memory buffer
OwningPtr<MemoryBuffer> BuffPtr;
- if (error_code ec = MemoryBuffer::getFile(uniqueObjStr.c_str(),BuffPtr))
+ if (error_code ec = MemoryBuffer::getFile(uniqueObjStr.c_str(), BuffPtr,
+ -1, false)) {
errMsg = ec.message();
+ return NULL;
+ }
_nativeObjectFile = BuffPtr.take();
// remove temp files