1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

Fix a memory leak after rL341386.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D51658

llvm-svn: 341412
This commit is contained in:
Hiroshi Yamauchi 2018-09-04 21:28:22 +00:00
parent 1312bc6529
commit 3b619a8745

View File

@ -1753,8 +1753,8 @@ BranchInst *CHR::createMergedBranch(BasicBlock *PreEntryBlock,
"NewEntryBlock's only pred must be EntryBlock");
assert(VMap.find(NewEntryBlock) != VMap.end() &&
"NewEntryBlock must have been copied");
OldBR->removeFromParent();
OldBR->dropAllReferences();
OldBR->eraseFromParent();
// The true predicate is a placeholder. It will be replaced later in
// fixupBranchesAndSelects().
BranchInst *NewBR = BranchInst::Create(NewEntryBlock,