]> granicus.if.org Git - clang/commitdiff
Add test case for <rdar://problem/6829164>, which was implicitly fixed in r79694.
authorTed Kremenek <kremenek@apple.com>
Mon, 21 Sep 2009 23:22:11 +0000 (23:22 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 21 Sep 2009 23:22:11 +0000 (23:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82495 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/misc-ps.m

index d7c3db7439d35bc9f74715253c069618367ea60f..f05ec956437253d49006a6f9679dea094f758b40 100644 (file)
@@ -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