mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Fix a double free in llvm::getBitcodeTargetTriple.
Unfortunately this is only used by ld64, so no testcase, but should fix the darwin LTO bootstrap. llvm-svn: 216618
This commit is contained in:
parent
8c8c692bd7
commit
c3b6a25c56
@ -3588,7 +3588,7 @@ ErrorOr<Module *> llvm::parseBitcodeFile(MemoryBufferRef Buffer,
|
||||
std::string llvm::getBitcodeTargetTriple(MemoryBufferRef Buffer,
|
||||
LLVMContext &Context) {
|
||||
std::unique_ptr<MemoryBuffer> Buf = MemoryBuffer::getMemBuffer(Buffer, false);
|
||||
auto R = llvm::make_unique<BitcodeReader>(Buf.get(), Context);
|
||||
auto R = llvm::make_unique<BitcodeReader>(Buf.release(), Context);
|
||||
ErrorOr<std::string> Triple = R->parseTriple();
|
||||
if (Triple.getError())
|
||||
return "";
|
||||
|
Loading…
Reference in New Issue
Block a user