aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/IPA
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-04-20 12:16:50 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-04-20 12:16:50 +0000
commiteb1f4b1899fdbb95807c3dcaa5f03f5129c4a156 (patch)
treebf97dfd13465ae256374f39d32427cc242d49122 /lib/Analysis/IPA
parent7c43f4357d0ba0351af4ee5651ef2bf5286ab16f (diff)
downloadexternal_llvm-eb1f4b1899fdbb95807c3dcaa5f03f5129c4a156.zip
external_llvm-eb1f4b1899fdbb95807c3dcaa5f03f5129c4a156.tar.gz
external_llvm-eb1f4b1899fdbb95807c3dcaa5f03f5129c4a156.tar.bz2
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
Diffstat (limited to 'lib/Analysis/IPA')
-rw-r--r--lib/Analysis/IPA/CallGraph.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index c59c31c..62a4c31 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/lib/Analysis/IPA/CallGraph.cpp
@@ -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();
}
};