summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-09-21 23:22:11 +0000
committerTed Kremenek <kremenek@apple.com>2009-09-21 23:22:11 +0000
commitfd68c7bdc0ea3a61b90380eab3db89230c6b5f27 (patch)
tree84883f7c429e5e66cc3b516e8ab7ed5e3b234f80 /clang
parent71848a3ff12f5be30a37bb422147c25fe4ff1cef (diff)
downloadbcm5719-llvm-fd68c7bdc0ea3a61b90380eab3db89230c6b5f27.tar.gz
bcm5719-llvm-fd68c7bdc0ea3a61b90380eab3db89230c6b5f27.zip
Add test case for <rdar://problem/6829164>, which was implicitly fixed in r79694.
llvm-svn: 82495
Diffstat (limited to 'clang')
-rw-r--r--clang/test/Analysis/misc-ps.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/Analysis/misc-ps.m b/clang/test/Analysis/misc-ps.m
index d7c3db7439d..f05ec956437 100644
--- a/clang/test/Analysis/misc-ps.m
+++ b/clang/test/Analysis/misc-ps.m
@@ -610,3 +610,25 @@ void test_offsetof_4() {
*p = 0xDEADBEEF; // expected-warning{{Dereference of null pointer}}
}
+// <rdar://problem/6829164> "nil receiver" false positive: make tracking
+// of the MemRegion for 'self' path-sensitive
+@interface RDar6829164 : NSObject {
+ double x; int y;
+}
+- (id) init;
+@end
+
+id rdar_6829164_1();
+double rdar_6829164_2();
+
+@implementation RDar6829164
+- (id) init {
+ if((self = [super init]) != 0) {
+ id z = rdar_6829164_1();
+ y = (z != 0);
+ if (y)
+ x = rdar_6829164_2();
+ }
+ return self;
+}
+@end
OpenPOWER on IntegriCloud