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
This commit is contained in:
Benjamin Kramer 2010-08-21 15:07:23 +00:00
parent da0bfcdaf9
commit 9dd3e92e1d

View File

@ -263,10 +263,8 @@ void MDNode::deleteTemporary(MDNode *N) {
"Temporary MDNode does not have NotUniquedBit set!"); "Temporary MDNode does not have NotUniquedBit set!");
assert((N->getSubclassDataFromValue() & DestroyFlag) == 0 && assert((N->getSubclassDataFromValue() & DestroyFlag) == 0 &&
"Temporary MDNode has DestroyFlag set!"); "Temporary MDNode has DestroyFlag set!");
N->setValueSubclassData(N->getSubclassDataFromValue() |
DestroyFlag);
LeakDetector::removeGarbageObject(N); LeakDetector::removeGarbageObject(N);
delete N; N->destroy();
} }
/// getOperand - Return specified operand. /// getOperand - Return specified operand.