summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CallGraph.cpp
diff options
context:
space:
mode:
authorMatt Beaumont-Gay <matthewbg@google.com>2012-03-14 20:21:25 +0000
committerMatt Beaumont-Gay <matthewbg@google.com>2012-03-14 20:21:25 +0000
commitdcc425ec19331bb134e42b5bab9ecad4ce61c25f (patch)
treeb2a7986873706b21f6bcb7838a4fad4ad2c32fe8 /clang/lib/Analysis/CallGraph.cpp
parent30b8416d2c7154b86f3d0c01c18a05ab3838e6f5 (diff)
downloadbcm5719-llvm-dcc425ec19331bb134e42b5bab9ecad4ce61c25f.tar.gz
bcm5719-llvm-dcc425ec19331bb134e42b5bab9ecad4ce61c25f.zip
Fix dereference of end iterator. Spotted by ASan.
llvm-svn: 152738
Diffstat (limited to 'clang/lib/Analysis/CallGraph.cpp')
-rw-r--r--clang/lib/Analysis/CallGraph.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Analysis/CallGraph.cpp b/clang/lib/Analysis/CallGraph.cpp
index 1e9aec23dd6..eb3f3ef97ac 100644
--- a/clang/lib/Analysis/CallGraph.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud