aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2013-04-05 23:50:11 +0000
committerAnna Zaks <ganna@apple.com>2013-04-05 23:50:11 +0000
commit4b69feb6d90eb120d04f5d54f6b28cc295a46098 (patch)
tree6b083d30bd2a54cd3264b9442cc61e34c0cedcbd /lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
parentf608aff66c5412ab583258f989417b4974ba507a (diff)
[analyzer] Fix null tracking for the given test case, by using the proper state and removing redundant code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178933 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/BugReporterVisitors.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/BugReporterVisitors.cpp21
1 files changed, 3 insertions, 18 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
index f600362da9..536064e1ad 100644
--- a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
+++ b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
@@ -926,22 +926,7 @@ bool bugreporter::trackNullOrUndefValue(const ExplodedNode *N,
if (R) {
// Mark both the variable region and its contents as interesting.
- SVal V = state->getRawSVal(loc::MemRegionVal(R));
-
- // If the value matches the default for the variable region, that
- // might mean that it's been cleared out of the state. Fall back to
- // the full argument expression (with casts and such intact).
- if (IsArg) {
- bool UseArgValue = V.isUnknownOrUndef() || V.isZeroConstant();
- if (!UseArgValue) {
- const SymbolRegionValue *SRV =
- dyn_cast_or_null<SymbolRegionValue>(V.getAsLocSymbol());
- if (SRV)
- UseArgValue = (SRV->getRegion() == R);
- }
- if (UseArgValue)
- V = state->getSValAsScalarOrLoc(S, N->getLocationContext());
- }
+ SVal V = LVState->getRawSVal(loc::MemRegionVal(R));
report.markInteresting(R);
report.markInteresting(V);
@@ -960,11 +945,11 @@ bool bugreporter::trackNullOrUndefValue(const ExplodedNode *N,
report.addVisitor(ConstraintTracker);
// Add visitor, which will suppress inline defensive checks.
- if (N->getState()->isNull(V).isConstrainedTrue() &&
+ if (LVState->isNull(V).isConstrainedTrue() &&
EnableNullFPSuppression) {
BugReporterVisitor *IDCSuppressor =
new SuppressInlineDefensiveChecksVisitor(V.castAs<DefinedSVal>(),
- N);
+ LVNode);
report.addVisitor(IDCSuppressor);
}
}