1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Take lock before removing a node from MDNodeSet.

llvm-svn: 81356
This commit is contained in:
Devang Patel 2009-09-09 17:44:26 +00:00
parent 2898d3cb86
commit 2cbc3ef1e9

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();
}