Test case: When using RegionStore with the retain/release checker, stop tracking objects assigned to self's ivar.

llvm-svn: 66139
This commit is contained in:
Ted Kremenek 2009-03-05 05:14:55 +00:00
parent 77a3cb2dfa
commit 2b24f306df
1 changed files with 17 additions and 0 deletions

View File

@ -99,3 +99,20 @@ CFAbsoluteTime f4() {
return t;
}
// Test that assigning to an self.ivar loses track of an object.
// This is a temporary hack to reduce false positives.
@interface Test3 : NSObject {
id myObj;
}
- (void)test_self_assign_ivar;
@end
@implementation Test3
- (void)test_self_assign_ivar {
CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
CFDateRef date = CFDateCreate(0, t); // no-warning
myObj = (id) date;
}
@end