summaryrefslogtreecommitdiffstats
path: root/test/Analysis/null-deref-ps.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/null-deref-ps.c')
-rw-r--r--test/Analysis/null-deref-ps.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/Analysis/null-deref-ps.c b/test/Analysis/null-deref-ps.c
index 7ca22ad..8daa845 100644
--- a/test/Analysis/null-deref-ps.c
+++ b/test/Analysis/null-deref-ps.c
@@ -64,13 +64,13 @@ 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])) {
+ if (!(p == &array[0])) { // expected-warning{{Both operands to '==' always have the same value}}
p = 0;
*p = 1; // no-warning
}
-
+
if (p) {
*p = 5; // no-warning
p = 0;
@@ -81,7 +81,6 @@ int f4_b() {
return 0;
}
-
int f5() {
char *s = "hello world";
@@ -280,7 +279,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; // no-warning
+ if (((((int) x) << 2) + 1) >> 1) *x = 1;
}
// PR 4759 - Attribute non-null checking by the analyzer was not correctly
OpenPOWER on IntegriCloud