PR6880: Don't dereference CallsExternalNode if it's NULL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101897 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2010-04-20 12:16:50 +00:00
parent 7c43f4357d
commit eb1f4b1899

View File

@ -158,9 +158,11 @@ private:
// destroy - Release memory for the call graph
virtual void destroy() {
/// CallsExternalNode is not in the function map, delete it explicitly.
CallsExternalNode->allReferencesDropped();
delete CallsExternalNode;
CallsExternalNode = 0;
if (CallsExternalNode) {
CallsExternalNode->allReferencesDropped();
delete CallsExternalNode;
CallsExternalNode = 0;
}
CallGraph::destroy();
}
};