aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-08-03 22:23:24 +0000
committerTed Kremenek <kremenek@apple.com>2009-08-03 22:23:24 +0000
commit28ba10ce2ad9b03ec33db3790a519d64a2e16b6a (patch)
tree85776aaa8f0341811b5b86975cb4189ea1434d03
parent434da48d0e35764f18b3fc96c75504746050b046 (diff)
Add test case testing field sensitivity. Reduced from <rdar://problem/7114618>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78008 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Analysis/misc-ps-region-store.m15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Analysis/misc-ps-region-store.m b/test/Analysis/misc-ps-region-store.m
index 2b0299f23f..6cfd8e5372 100644
--- a/test/Analysis/misc-ps-region-store.m
+++ b/test/Analysis/misc-ps-region-store.m
@@ -139,3 +139,18 @@ again:
goto again;
}
}
+
+// Reduced test case from <rdar://problem/7114618>.
+// Basically a null check is performed on the field value, which is then
+// assigned to a variable and then checked again.
+struct s_7114618 { int *p; };
+void test_rdar_7114618(struct s_7114618 *s) {
+ if (s->p) {
+ int *p = s->p;
+ if (!p) {
+ // Infeasible
+ int *dead = 0;
+ *dead = 0xDEADBEEF; // no-warning
+ }
+ }
+}