[cfe-commits] PATCH: Fix dereference of end iterator
Matt Beaumont-Gay
matthewbg at google.com
Wed Mar 14 11:39:22 PDT 2012
Spotted by ASan via test/Analysis/func.c.
--- a/lib/Analysis/CallGraph.cpp 2012-03-13 16:21:39.000000000 -0700
+++ b/lib/Analysis/CallGraph.cpp 2012-03-14 11:26:25.000000000 -0700
@@ -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