Take lock before removing a node from MDNodeSet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81356 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2009-09-09 17:44:26 +00:00
parent 740fce3020
commit 88cfd964a3

View File

@ -115,7 +115,11 @@ void MDNode::dropAllReferences() {
}
MDNode::~MDNode() {
getType()->getContext().pImpl->MDNodeSet.RemoveNode(this);
{
LLVMContextImpl *pImpl = getType()->getContext().pImpl;
sys::SmartScopedWriter<true> Writer(pImpl->ConstantsLock);
pImpl->MDNodeSet.RemoveNode(this);
}
dropAllReferences();
}