From fd68c7bdc0ea3a61b90380eab3db89230c6b5f27 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 21 Sep 2009 23:22:11 +0000 Subject: [PATCH] Add test case for , which was implicitly fixed in r79694. llvm-svn: 82495 --- clang/test/Analysis/misc-ps.m | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/clang/test/Analysis/misc-ps.m b/clang/test/Analysis/misc-ps.m index d7c3db7439d3..f05ec9564372 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}} } +// "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