mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-24 12:19:53 +00:00
llvm-uselistorder: Fix memory leak from r214125
Turns out `parseBitcodeFile()` does *not* take ownership of the buffer. This was already clear in the header docs, but I obviously didn't read them (having noticed that it gets stored in a `unique_ptr<>`). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214313 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4366b6cede
commit
e188fa672b
@ -137,7 +137,7 @@ std::unique_ptr<Module> TempFile::readBitcode(LLVMContext &Context) const {
|
||||
}
|
||||
|
||||
std::unique_ptr<MemoryBuffer> Buffer = std::move(BufferOr.get());
|
||||
ErrorOr<Module *> ModuleOr = parseBitcodeFile(Buffer.release(), Context);
|
||||
ErrorOr<Module *> ModuleOr = parseBitcodeFile(Buffer.get(), Context);
|
||||
if (!ModuleOr) {
|
||||
DEBUG(dbgs() << "error: " << ModuleOr.getError().message() << "\n");
|
||||
return nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user