[PATCH] D51658: Fix a memory leak after rL341386.

Hiroshi Yamauchi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 4 14:21:54 PDT 2018


yamauchi updated this revision to Diff 163920.
yamauchi added a comment.

Rebased.


Repository:
  rL LLVM

https://reviews.llvm.org/D51658

Files:
  lib/Transforms/Instrumentation/ControlHeightReduction.cpp


Index: lib/Transforms/Instrumentation/ControlHeightReduction.cpp
===================================================================
--- lib/Transforms/Instrumentation/ControlHeightReduction.cpp
+++ lib/Transforms/Instrumentation/ControlHeightReduction.cpp
@@ -1753,8 +1753,8 @@
          "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,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51658.163920.patch
Type: text/x-patch
Size: 692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180904/7947669a/attachment.bin>


More information about the llvm-commits mailing list