[cfe-commits] [PATCH][Review Request] - fix some core dumps when analyzing C++ operator calls

Ted Kremenek kremenek at apple.com
Fri Sep 17 16:03:05 PDT 2010


Hi Jim,

Can you also provide a test case so that we don't regress in the future?  Thanks.


On Sep 17, 2010, at 5:39 AM, Jim Goodnow II wrote:

> Just a couple of crashes when some of the experimental checkers tried to analyze C++ operator calls.
> 
> - jim
> 
> Index: lib/Checker/CStringChecker.cpp
> ===================================================================
> --- lib/Checker/CStringChecker.cpp	(revision 113834)
> +++ lib/Checker/CStringChecker.cpp	(working copy)
> @@ -901,6 +901,9 @@
>   const Expr *Callee = CE->getCallee();
>   const FunctionDecl *FD = state->getSVal(Callee).getAsFunctionDecl();
> 
> +  // Ignore C++ operator calls or getName() will implode
> +  if (isa<CXXOperatorCallExpr>(CE))
> +    return false;
>   if (!FD)
>     return false;
> 
> Index: lib/Checker/PthreadLockChecker.cpp
> ===================================================================
> --- lib/Checker/PthreadLockChecker.cpp	(revision 113834)
> +++ lib/Checker/PthreadLockChecker.cpp	(working copy)
> @@ -62,6 +62,9 @@
>   const FunctionTextRegion *R =
>     dyn_cast_or_null<FunctionTextRegion>(state->getSVal(Callee).getAsRegion());
> 
> +  // Ignore C++ operator calls or getName() will implode
> +  if (isa<CXXOperatorCallExpr>(CE))
> +    return;
>   if (!R)
>     return;
>   <opcall.patch>_______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list