[cfe-commits] r152738 - /cfe/trunk/lib/Analysis/CallGraph.cpp
Matt Beaumont-Gay
matthewbg at google.com
Wed Mar 14 13:21:25 PDT 2012
Author: matthewbg
Date: Wed Mar 14 15:21:25 2012
New Revision: 152738
URL: http://llvm.org/viewvc/llvm-project?rev=152738&view=rev
Log:
Fix dereference of end iterator. Spotted by ASan.
Modified:
cfe/trunk/lib/Analysis/CallGraph.cpp
Modified: cfe/trunk/lib/Analysis/CallGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CallGraph.cpp?rev=152738&r1=152737&r2=152738&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CallGraph.cpp (original)
+++ cfe/trunk/lib/Analysis/CallGraph.cpp Wed Mar 14 15:21:25 2012
@@ -133,7 +133,9 @@
}
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) {
More information about the cfe-commits
mailing list