r178380 - [analyzer] Look for a StmtPoint node instead of PostStmt in trackNullOrUndefValue.

Anna Zaks ganna at apple.com
Fri Mar 29 15:32:34 PDT 2013


Author: zaks
Date: Fri Mar 29 17:32:34 2013
New Revision: 178380

URL: http://llvm.org/viewvc/llvm-project?rev=178380&view=rev
Log:
[analyzer] Look for a StmtPoint node instead of PostStmt in trackNullOrUndefValue.

trackNullOrUndefValue tries to find the first node that matches the statement it is tracking.
Since we collect PostStmt nodes (in node reclamation), none of those might be on the
current path, so relax the search to look for any StmtPoint.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp?rev=178380&r1=178379&r2=178380&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp Fri Mar 29 17:32:34 2013
@@ -845,7 +845,7 @@ bool bugreporter::trackNullOrUndefValue(
     // gone too far (though we can likely track the lvalue better anyway).
     do {
       const ProgramPoint &pp = N->getLocation();
-      if (Optional<PostStmt> ps = pp.getAs<PostStmt>()) {
+      if (Optional<StmtPoint> ps = pp.getAs<StmtPoint>()) {
         if (ps->getStmt() == S || ps->getStmt() == Inner)
           break;
       } else if (Optional<CallExitEnd> CEE = pp.getAs<CallExitEnd>()) {





More information about the cfe-commits mailing list