diff options
author | Matt Beaumont-Gay <matthewbg@google.com> | 2012-03-14 20:21:25 +0000 |
---|---|---|
committer | Matt Beaumont-Gay <matthewbg@google.com> | 2012-03-14 20:21:25 +0000 |
commit | d53e877ddf885da28aa4668148a5f0ce0045ab54 (patch) | |
tree | 7c84883736d81be6d8fa8e7d64f0f4d9609e2bb9 /lib/Analysis | |
parent | 9373937945e1e075dfa08169eaccc1ad0b31f699 (diff) |
Fix dereference of end iterator. Spotted by ASan.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152738 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/CallGraph.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Analysis/CallGraph.cpp b/lib/Analysis/CallGraph.cpp index 1e9aec23dd..eb3f3ef97a 100644 --- a/lib/Analysis/CallGraph.cpp +++ b/lib/Analysis/CallGraph.cpp @@ -133,7 +133,9 @@ void CallGraph::addToCallGraph(TranslationUnitDecl *TU) { } CallGraphNode *CallGraph::getNode(const Decl *F) const { - return FunctionMap.find(F)->second; + FunctionMapTy::const_iterator I = FunctionMap.find(F); + if (I == FunctionMap.end()) return 0; + return I->second; } CallGraphNode *CallGraph::getOrInsertFunction(Decl *F) { |