]> granicus.if.org Git - clang/commitdiff
[analyzer] Look for a StmtPoint node instead of PostStmt in trackNullOrUndefValue.
authorAnna Zaks <ganna@apple.com>
Fri, 29 Mar 2013 22:32:34 +0000 (22:32 +0000)
committerAnna Zaks <ganna@apple.com>
Fri, 29 Mar 2013 22:32:34 +0000 (22:32 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178380 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/BugReporterVisitors.cpp

index 31ba5729eace4158ee859cd459450adc295ec97a..11218c086b9e3d2b09ff6b2c7d82fdee7cee92cf 100644 (file)
@@ -845,7 +845,7 @@ bool bugreporter::trackNullOrUndefValue(const ExplodedNode *N,
     // 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>()) {