[ImplicitNullChecks] Fix a memory leak.
authorSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 9 Jul 2015 20:13:31 +0000 (20:13 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 9 Jul 2015 20:13:31 +0000 (20:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241851 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/ImplicitNullChecks.cpp

index 5faeae4527ab1e4c126a28e68e8efccc6c9a7b87..93e04876a8f32effe7f037cfb6becc4e199591d0 100644 (file)
@@ -320,7 +320,7 @@ void ImplicitNullChecks::rewriteNullChecks(
     // touch the successors list for any basic block since we haven't changed
     // control flow, we've just made it implicit.
     insertFaultingLoad(NC.MemOperation, NC.CheckBlock, HandlerLabel);
-    NC.MemOperation->removeFromParent();
+    NC.MemOperation->eraseFromParent();
     NC.CheckOperation->eraseFromParent();
 
     // Insert an *unconditional* branch to not-null successor.