From 9dd3e92e1d73b8aee01861b22447898cba9f89bc Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 21 Aug 2010 15:07:23 +0000 Subject: [PATCH] Use MDNode::destroy(). Fixes a delete/free mismatch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111739 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Metadata.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/VMCore/Metadata.cpp b/lib/VMCore/Metadata.cpp index 909c33d55bc..bccdafa9cd1 100644 --- a/lib/VMCore/Metadata.cpp +++ b/lib/VMCore/Metadata.cpp @@ -263,10 +263,8 @@ void MDNode::deleteTemporary(MDNode *N) { "Temporary MDNode does not have NotUniquedBit set!"); assert((N->getSubclassDataFromValue() & DestroyFlag) == 0 && "Temporary MDNode has DestroyFlag set!"); - N->setValueSubclassData(N->getSubclassDataFromValue() | - DestroyFlag); LeakDetector::removeGarbageObject(N); - delete N; + N->destroy(); } /// getOperand - Return specified operand.