summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2016-01-29 18:43:15 +0000
committerAnna Zaks <ganna@apple.com>2016-01-29 18:43:15 +0000
commitad9e7ea6d703b88986ebc3cebf191a2e23711cbf (patch)
tree197e7653dbb649c7c532791b706a236b848d1641 /clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp
parent6ea637af35c992cb3bece3e3e9e8de9cc42b8cd1 (diff)
downloadbcm5719-llvm-ad9e7ea6d703b88986ebc3cebf191a2e23711cbf.tar.gz
bcm5719-llvm-ad9e7ea6d703b88986ebc3cebf191a2e23711cbf.zip
[analyzer] Improve Nullability checker diagnostics
- Include the position of the argument on which the nullability is violated - Differentiate between a 'method' and a 'function' in the message wording - Test for the error message text in the tests - Fix a bug with setting 'IsDirectDereference' which resulted in regular dereferences assumed to have call context. llvm-svn: 259221
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp
index f216f696ef6..152b937bb03 100644
--- a/clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp
@@ -230,7 +230,7 @@ void DereferenceChecker::checkLocation(SVal l, bool isLoad, const Stmt* S,
// dereference.
if (ExplodedNode *N = C.generateSink(nullState, C.getPredecessor())) {
ImplicitNullDerefEvent event = {l, isLoad, N, &C.getBugReporter(),
- /*IsDirectDereference=*/false};
+ /*IsDirectDereference=*/true};
dispatchEvent(event);
}
}
@@ -272,7 +272,7 @@ void DereferenceChecker::checkBind(SVal L, SVal V, const Stmt *S,
if (ExplodedNode *N = C.generateSink(StNull, C.getPredecessor())) {
ImplicitNullDerefEvent event = {V, /*isLoad=*/true, N,
&C.getBugReporter(),
- /*IsDirectDereference=*/false};
+ /*IsDirectDereference=*/true};
dispatchEvent(event);
}
}
OpenPOWER on IntegriCloud