From 97cfa7dc0aca6cc88f5c0033a1b848f883329055 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 23 Aug 2010 22:32:05 +0000 Subject: [PATCH] Verify that a non-uniqued non-temporary MDNode is not deleted via MDNode::deleteTemporary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111853 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Metadata.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/VMCore/Metadata.cpp b/lib/VMCore/Metadata.cpp index bccdafa9cd1..7f7b9eca59a 100644 --- a/lib/VMCore/Metadata.cpp +++ b/lib/VMCore/Metadata.cpp @@ -258,7 +258,9 @@ MDNode *MDNode::getTemporary(LLVMContext &Context, Value *const *Vals, void MDNode::deleteTemporary(MDNode *N) { assert(N->use_empty() && "Temporary MDNode has uses!"); assert(!N->getContext().pImpl->MDNodeSet.RemoveNode(N) && - "Deleting a non-temporary node!"); + "Deleting a non-temporary uniqued node!"); + assert(!N->getContext().pImpl->NonUniquedMDNodes.erase(N) && + "Deleting a non-temporary non-uniqued node!"); assert((N->getSubclassDataFromValue() & NotUniquedBit) && "Temporary MDNode does not have NotUniquedBit set!"); assert((N->getSubclassDataFromValue() & DestroyFlag) == 0 &&