summaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer
diff options
context:
space:
mode:
authorCsaba Dabis <dabis.csaba98@gmail.com>2019-08-22 00:06:58 +0000
committerCsaba Dabis <dabis.csaba98@gmail.com>2019-08-22 00:06:58 +0000
commitb55c8505d68ca889a022da275aa53143917fea8a (patch)
tree1825edb69ad659da8cc239bb9231729be2410e77 /lib/StaticAnalyzer
parentbc226679135d1105b97157c2b740e6c4a8b70060 (diff)
downloadclang-b55c8505d68ca889a022da275aa53143917fea8a.tar.gz
[analyzer] TrackConstraintBRVisitor: Do not track unknown values
Summary: - Reviewers: NoQ, Szelethus Reviewed By: NoQ, Szelethus Differential Revision: https://reviews.llvm.org/D66267 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@369604 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer')
-rw-r--r--lib/StaticAnalyzer/Core/BugReporterVisitors.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
index 973580ed00..20af02842c 100644
--- a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
+++ b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
@@ -1992,9 +1992,10 @@ bool bugreporter::trackExpressionValue(const ExplodedNode *InputNode,
report.markInteresting(V, TKind);
report.addVisitor(std::make_unique<UndefOrNullArgVisitor>(R));
- // If the contents are symbolic, find out when they became null.
- if (V.getAsLocSymbol(/*IncludeBaseRegions*/ true))
- report.addVisitor(std::make_unique<TrackConstraintBRVisitor>(
+ // If the contents are symbolic and null, find out when they became null.
+ if (V.getAsLocSymbol(/*IncludeBaseRegions=*/true))
+ if (LVState->isNull(V).isConstrainedTrue())
+ report.addVisitor(std::make_unique<TrackConstraintBRVisitor>(
V.castAs<DefinedSVal>(), false));
// Add visitor, which will suppress inline defensive checks.