[cfe-commits] PATCH: Fix dereference of end iterator
Chandler Carruth
chandlerc at google.com
Wed Mar 14 13:23:22 PDT 2012
LGTM, please commit.
On Wed, Mar 14, 2012 at 11:39 AM, Matt Beaumont-Gay <matthewbg at google.com>wrote:
> 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) {
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120314/3bfe0bcc/attachment.html>
More information about the cfe-commits
mailing list