summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/test/Analysis/null-deref-ps.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/test/Analysis/null-deref-ps.c b/clang/test/Analysis/null-deref-ps.c
index 6da44d0c73f..92e8daa57e2 100644
--- a/clang/test/Analysis/null-deref-ps.c
+++ b/clang/test/Analysis/null-deref-ps.c
@@ -77,4 +77,12 @@ int f7(int x) {
return x;
}
-
+int f8(int *p, int *q) {
+ if (!p)
+ if (p)
+ *p = 1; // no-warning
+
+ if (q)
+ if (!q)
+ *q = 1; // no-warning
+}
OpenPOWER on IntegriCloud