[cfe-commits] r117908 - in /cfe/trunk: include/clang/Checker/PathSensitive/GRExprEngine.h lib/Checker/AggExprVisitor.cpp lib/Checker/GRCXXExprEngine.cpp lib/Checker/GRExprEngine.cpp test/Analysis/method-call.cpp

Jim Goodnow II jim at thegoodnows.net
Thu Nov 4 21:15:53 PDT 2010


Hmm, this wiped out a bit of a temporary kludge that I had placed in 
VisitDeclStmt when VisitAggExpr gets called. What happens is that 
after winding through all the Visits in AggExprVisitor and winding 
back, the Dst ExplodedNodeSet never gets updated with Pred. This has 
the consequence that the ensuing CheckerVisit call bails out early 
and PreVisitDeclStmt never gets called for a class being initialized 
as part of the declaration, i.e.:

vector<int>::iterator it = v.begin();

never calls PreVisitDeclStmt. The workaround is to add a:

if(Dst.empty())
   Dst.Add(Pred);

after the call to VisitAggExpr in VisitCXXConstructExpr or before 
returning from VisitAggExpr itself as a more general case.

I don't think putting it in VisitDeclStmt itself is a good idea since 
there may be legitimate cases where the node doesn't get propagated.

  - jim




More information about the cfe-commits mailing list