summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/null-deref-ps.c
diff options
context:
space:
mode:
authorTom Care <tom.care@uqconnect.edu.au>2010-08-12 22:45:47 +0000
committerTom Care <tom.care@uqconnect.edu.au>2010-08-12 22:45:47 +0000
commitf8a9863df942e69d58e34432da3532a4ead650ad (patch)
tree33e95eec6ee0e8fc7f6fccec372afa66834ab9d7 /clang/test/Analysis/null-deref-ps.c
parentb5a6246b91cc4240b2b5113aaf2d181021f64ba7 (diff)
downloadbcm5719-llvm-f8a9863df942e69d58e34432da3532a4ead650ad.tar.gz
bcm5719-llvm-f8a9863df942e69d58e34432da3532a4ead650ad.zip
Improved IdempotentOperationChecker false positives and false negatives.
- Unfinished analysis may still report valid warnings if the path was completely analyzed - New 'CanVary' heuristic to recursively determine if a subexpression has a varying element - Updated test cases, including one known bug - Exposed GRCoreEngine through GRExprEngine llvm-svn: 110970
Diffstat (limited to 'clang/test/Analysis/null-deref-ps.c')
-rw-r--r--clang/test/Analysis/null-deref-ps.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/clang/test/Analysis/null-deref-ps.c b/clang/test/Analysis/null-deref-ps.c
index 9be73a8c0f2..1ae94c709bb 100644
--- a/clang/test/Analysis/null-deref-ps.c
+++ b/clang/test/Analysis/null-deref-ps.c
@@ -60,27 +60,7 @@ int f4(int *p) {
return *q; // expected-warning{{Dereference of null pointer (loaded from variable 'q')}}
}
-int f4_b() {
- short array[2];
- uintptr_t x = array; // expected-warning{{incompatible pointer to integer conversion}}
- short *p = x; // expected-warning{{incompatible integer to pointer conversion}}
-
- // The following branch should be infeasible.
- if (!(p = &array[0])) {
- p = 0;
- *p = 1; // no-warning
- }
-
- if (p) {
- *p = 5; // no-warning
- p = 0;
- }
- else return; // expected-warning {{non-void function 'f4_b' should return a value}}
-
- *p += 10; // expected-warning{{Dereference of null pointer}}
- return 0;
-}
-
+// Placeholder for f4_b, temporarily moved to null-deref-ps-temp.c
int f5() {
@@ -280,7 +260,7 @@ void f12(HF12ITEM i, char *q) {
// Test handling of translating between integer "pointers" and back.
void f13() {
int *x = 0;
- if (((((int) x) << 2) + 1) >> 1) *x = 1; // expected-warning{{he left operand to '<<' is always 0}}
+ if (((((int) x) << 2) + 1) >> 1) *x = 1; // expected-warning{{The left operand to '<<' is always 0}} expected-warning{{The left operand to '+' is always 0}}
}
// PR 4759 - Attribute non-null checking by the analyzer was not correctly
OpenPOWER on IntegriCloud