aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2013-03-06 20:25:59 +0000
committerAnna Zaks <ganna@apple.com>2013-03-06 20:25:59 +0000
commit713e07591995d761f65c7132289dce003a29870f (patch)
tree77a076777e379ca232ee7ed34b93c2d59a6b77fd /lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
parent398253ab0e0dedc6f5ddb1bad2ac6a084d0d88a8 (diff)
[analyzer] IDC: Add config option; perform the idc check on first “null node” rather than last “non-null”.
The second modification does not lead to any visible result, but, theoretically, is what we should have been looking at to begin with since we are checking if the node was assumed to be null in an inlined function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176576 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/BugReporterVisitors.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/BugReporterVisitors.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
index b4ba2d4789..248f21cb71 100644
--- a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
+++ b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
@@ -690,7 +690,12 @@ SuppressInlineDefensiveChecksVisitor::VisitNode(const ExplodedNode *N,
BugReport &BR) {
if (IsSatisfied)
return 0;
-
+
+ AnalyzerOptions &Options =
+ BRC.getBugReporter().getEngine().getAnalysisManager().options;
+ if (!Options.shouldSuppressInlinedDefensiveChecks())
+ return 0;
+
// Check if in the previous state it was feasible for this value
// to *not* be null.
if (PrevN->getState()->assume(V, true)) {
@@ -700,7 +705,7 @@ SuppressInlineDefensiveChecksVisitor::VisitNode(const ExplodedNode *N,
// is non-null in N could lead to false negatives.
// Check if this is inline defensive checks.
- const LocationContext *CurLC = PrevN->getLocationContext();
+ const LocationContext *CurLC = N->getLocationContext();
const LocationContext *ReportLC = BR.getErrorNode()->getLocationContext();
if (CurLC != ReportLC && !CurLC->isParentOf(ReportLC))
BR.markInvalid("Suppress IDC", CurLC);