summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/null-deref-ps.c
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-10-26 00:06:13 +0000
committerTed Kremenek <kremenek@apple.com>2010-10-26 00:06:13 +0000
commit731310e13e8c29eed4cfcd5bc24bd6b2992e536f (patch)
tree4e35ca81490d18b9d79cc1b2f929ba0ece3c7970 /clang/test/Analysis/null-deref-ps.c
parente1961fe2891ed1dd08a6aee74e1a02b83653f9df (diff)
downloadbcm5719-llvm-731310e13e8c29eed4cfcd5bc24bd6b2992e536f.tar.gz
bcm5719-llvm-731310e13e8c29eed4cfcd5bc24bd6b2992e536f.zip
Tweak null dereference checker to give better diagnostics for null dereferences resulting from array accesses.
llvm-svn: 117334
Diffstat (limited to 'clang/test/Analysis/null-deref-ps.c')
-rw-r--r--clang/test/Analysis/null-deref-ps.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/Analysis/null-deref-ps.c b/clang/test/Analysis/null-deref-ps.c
index 58f5d30c093..1e3f2db34b2 100644
--- a/clang/test/Analysis/null-deref-ps.c
+++ b/clang/test/Analysis/null-deref-ps.c
@@ -26,7 +26,7 @@ int f2(struct foo_struct* p) {
if (p)
p->x = 1;
- return p->x++; // expected-warning{{Field access results in a dereference of a null pointer (loaded from variable 'p')}}
+ return p->x++; // expected-warning{{Access to field 'x' results in a dereference of a null pointer (loaded from variable 'p')}}
}
int f3(char* x) {
@@ -36,7 +36,7 @@ int f3(char* x) {
if (x)
return x[i - 1];
- return x[i+1]; // expected-warning{{Dereference of null pointer}}
+ return x[i+1]; // expected-warning{{Array access (from variable 'x') results in a null pointer dereference}}
}
int f3_b(char* x) {
@@ -46,7 +46,7 @@ int f3_b(char* x) {
if (x)
return x[i - 1];
- return x[i+1]++; // expected-warning{{Dereference of null pointer}}
+ return x[i+1]++; // expected-warning{{Array access (from variable 'x') results in a null pointer dereference}}
}
int f4(int *p) {
OpenPOWER on IntegriCloud