diff --git a/lib/VMCore/Metadata.cpp b/lib/VMCore/Metadata.cpp index 208e1bcedcc..60ec1c5c6ca 100644 --- a/lib/VMCore/Metadata.cpp +++ b/lib/VMCore/Metadata.cpp @@ -101,8 +101,8 @@ static std::vector getValType(MDNode *N) { } MDNode::~MDNode() { - dropAllReferences(); getType()->getContext().pImpl->MDNodes.remove(this); + dropAllReferences(); } //===----------------------------------------------------------------------===//