We don't need a null terminator for the output file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128098 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2011-03-22 19:20:47 +00:00
parent c1dbd5d9c3
commit 11d1803770
3 changed files with 16 additions and 7 deletions

View File

@@ -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