diff options
author | Anna Zaks <ganna@apple.com> | 2013-03-14 22:31:56 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2013-03-14 22:31:56 +0000 |
commit | a4bb4f6ca8dd31ad96cb9526a5abe1273f18ff40 (patch) | |
tree | a281e24722f20a618fa3ccc7d14e1b2cfb559f0c /include/clang/StaticAnalyzer/Core | |
parent | bea407c92780ded6ef9aabc9d8ebbe60d233f381 (diff) |
[analyzer] Change the way in which IDC Visitor decides to kick in and make sure it attaches in the given edge case
In the test case below, the value V is not constrained to 0 in ErrorNode but it is in node N.
So we used to fail to register the Suppression visitor.
We also need to change the way we determine that the Visitor should kick in because the node N belongs to
the ExplodedGraph and might not be on the BugReporter path that the visitor sees. Instead of trying to match the node,
turn on the visitor when we see the last node in which the symbol is ‘0’.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177121 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/StaticAnalyzer/Core')
-rw-r--r-- | include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h index 17c1009853..aad2ab1772 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h @@ -290,12 +290,12 @@ class SuppressInlineDefensiveChecksVisitor /// Track if we found the node where the constraint was first added. bool IsSatisfied; - /// \brief The node from which we should start tracking the value. - /// Note: Since the visitors can be registered on nodes previous to the last + /// Since the visitors can be registered on nodes previous to the last /// node in the BugReport, but the path traversal always starts with the last /// node, the visitor invariant (that we start with a node in which V is null) - /// might not hold when node visitation starts. - const ExplodedNode *StartN; + /// might not hold when node visitation starts. We are going to start tracking + /// from the last node in which the value is null. + bool IsTrackingTurnedOn; public: SuppressInlineDefensiveChecksVisitor(DefinedSVal Val, const ExplodedNode *N); @@ -306,10 +306,6 @@ public: /// to make all PathDiagnosticPieces created by this visitor. static const char *getTag(); - PathDiagnosticPiece *getEndPath(BugReporterContext &BRC, - const ExplodedNode *N, - BugReport &BR); - PathDiagnosticPiece *VisitNode(const ExplodedNode *Succ, const ExplodedNode *Pred, BugReporterContext &BRC, |