diff options
author | Anna Zaks <ganna@apple.com> | 2012-03-08 23:16:26 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-03-08 23:16:26 +0000 |
commit | d2776613703a516f107decc06b38a0b60a10542c (patch) | |
tree | d138b2f3a5b2104bdbd881c5403adfb5ce44ed3b /lib | |
parent | e093404ee9fc6fc169304b51ec2f78ffafef16b9 (diff) |
Call Graph: Only the root node is allowed to have an invalid Decl*.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152350 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/CallGraph.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Analysis/CallGraph.cpp b/lib/Analysis/CallGraph.cpp index 79519d7512..ca73c4a161 100644 --- a/lib/Analysis/CallGraph.cpp +++ b/lib/Analysis/CallGraph.cpp @@ -87,6 +87,7 @@ CallGraph::~CallGraph() { } void CallGraph::addToCallGraph(Decl* D, bool IsGlobal) { + assert(D); CallGraphNode *Node = getOrInsertFunction(D); if (IsGlobal) @@ -141,7 +142,9 @@ CallGraphNode *CallGraph::getOrInsertFunction(Decl *F) { return Node; Node = new CallGraphNode(F); - ParentlessNodes.insert(Node); + // If not root, add to the parentless list. + if (F != 0) + ParentlessNodes.insert(Node); return Node; } |