diff options
| author | Devang Patel <dpatel@apple.com> | 2009-09-09 17:44:26 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2009-09-09 17:44:26 +0000 |
| commit | cbde073d8c3f952cdad9afb0da940ff6651266f6 (patch) | |
| tree | 772cbb66da77d959db5243f57b4ba171ac617f2a /llvm/lib/VMCore | |
| parent | 9a767cb5c0810bd451fa7434b7e73d5c65536459 (diff) | |
| download | bcm5719-llvm-cbde073d8c3f952cdad9afb0da940ff6651266f6.tar.gz bcm5719-llvm-cbde073d8c3f952cdad9afb0da940ff6651266f6.zip | |
Take lock before removing a node from MDNodeSet.
llvm-svn: 81356
Diffstat (limited to 'llvm/lib/VMCore')
| -rw-r--r-- | llvm/lib/VMCore/Metadata.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Metadata.cpp b/llvm/lib/VMCore/Metadata.cpp index 8e025b6d7a2..1163b4709ce 100644 --- a/llvm/lib/VMCore/Metadata.cpp +++ b/llvm/lib/VMCore/Metadata.cpp @@ -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(); } |

