Home | History | Annotate | Download | only in Analysis

Lines Matching full:retain

6 This file is for testing the path-sensitive notes for retain/release errors.
8 not to actually check all possible retain/release errors.
11 GC-specific notes should go in retain-release-path-notes-gc.m.
21 - (id)retain;
28 @property(retain) id propertyValue;
46 id leaked = [[NSObject alloc] init]; // expected-warning{{leak}} expected-note{{Method returns an Objective-C object with a +1 retain count}}
47 return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
51 CFTypeRef leaked = CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count}}
52 return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
56 id leaked = [foo methodWithValue]; // expected-warning{{leak}} expected-note{{Method returns an Objective-C object with a +0 retain count}}
57 [leaked retain]; // expected-note{{Reference count incremented. The object now has a +1 retain count}}
58 [leaked retain]; // expected-note{{Reference count incremented. The object now has a +2 retain count}}
59 [leaked release]; // expected-note{{Reference count decremented. The object now has a +1 retain count}}
60 return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
64 id leaked = foo.propertyValue; // expected-warning{{leak}} expected-note{{Property returns an Objective-C object with a +0 retain count}}
65 [leaked retain]; // expected-note{{Reference count incremented. The object now has a +1 retain count}}
66 return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
70 CFTypeRef leaked = CFGetSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object with a +0 retain count}}
71 CFRetain(leaked); // expected-note{{Reference count incremented. The object now has a +1 retain count}}
72 return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
76 id object = [[NSObject alloc] init]; // expected-note{{Method returns an Objective-C object with a +1 retain count}}
82 id object = [[NSObject alloc] init]; // expected-note{{Method returns an Objective-C object with a +1 retain count}}
88 id object = [[NSObject alloc] init]; // expected-note{{Method returns an Objective-C object with a +1 retain count}}
91 return; // expected-warning{{Object autoreleased too many times}} expected-note{{Object was autoreleased 2 times but the object has a +1 retain count}}
95 id object = foo.propertyValue; // expected-note{{Property returns an Objective-C object with a +0 retain count}}
97 return; // expected-warning{{Object autoreleased too many times}} expected-note{{Object was autoreleased but has a +0 retain count}}
101 CFTypeRef leaked = CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count}}
104 return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
108 CFTypeRef object = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object with a +0 retain count}}
109 return object; // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}} expected-note{{Object returned to caller with a +0 retain count}} expected-note{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
113 CFTypeRef object = CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count}}
114 return object; // expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'object' is returned from a function whose name ('CFGetRuleViolation') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation}}
119 id result = self.propertyValue; // expected-note{{Property returns an Objective-C object with a +0 retain count}}
120 return result; // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}} expected-note{{Object returned to caller with a +0 retain count}} expected-note{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
124 id result = self[0]; // expected-note{{Subscript returns an Objective-C object with a +0 retain count}}
125 return result; // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}} expected-note{{Object returned to caller with a +0 retain count}} expected-note{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
129 id result = self[self]; // expected-note{{Subscript returns an Objective-C object with a +0 retain count}}
130 return result; // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}} expected-note{{Object returned to caller with a +0 retain count}} expected-note{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
134 id result = [[Foo alloc] init]; // expected-warning{{leak}} expected-note{{Method returns an Objective-C object with a +1 retain count}}
135 return result; // expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'result' is returned from a method whose name ('getViolation') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'. This violates the naming convention rules given in the Memory Management Guide for Cocoa}}
139 id result = [[Foo alloc] init]; // expected-note{{Method returns an Objective-C object with a +1 retain count}}
141 return result; // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}} expected-note{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
169 id result = @1; // expected-note{{NSNumber literal is an object with a +0 retain count}}
174 id result = @(x); // expected-note{{NSNumber boxed expression produces an object with a +0 retain count}}
179 id result = @(str); // expected-note{{NSString boxed expression produces an object with a +0 retain count}}
184 id result = @[obj]; // expected-note{{NSArray literal is an object with a +0 retain count}}
189 id result = @{key: value}; // expected-note{{NSDictionary literal is an object with a +0 retain count}}
214 self = [super init]; //expected-note {{Method returns an Objective-C object with a +1 retain count}}
226 // expected-note@-1 {{Method returns an Objective-C object with a +1 retain count}}
229 // expected-note@-4 {{Object leaked: allocated object is not referenced later in this execution path and has a retain count of +1}}
237 // expected-note@-1 {{Object leaked: allocated object is not referenced later in this execution path and has a retain count of +1}}
308 // CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
310 // CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
371 // CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;leaked&apos; is not referenced later in this execution path and has a retain count of +1</string>
373 // CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;leaked&apos; is not referenced later in this execution path and has a retain count of +1</string>
451 // CHECK-NEXT: <string>Call to function &apos;CFCreateSomething&apos; returns a Core Foundation object with a +1 retain count</string>
453 // CHECK-NEXT: <string>Call to function &apos;CFCreateSomething&apos; returns a Core Foundation object with a +1 retain count</string>
514 // CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;leaked&apos; is not referenced later in this execution path and has a retain count of +1</string>
516 // CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;leaked&apos; is not referenced later in this execution path and has a retain count of +1</string>
594 // CHECK-NEXT: <string>Method returns an Objective-C object with a +0 retain count</string>
596 // CHECK-NEXT: <string>Method returns an Objective-C object with a +0 retain count</string>
669 // CHECK-NEXT: <string>Reference count incremented. The object now has a +1 retain count</string>
671 // CHECK-NEXT: <string>Reference count incremented. The object now has a +1 retain count</string>
744 // CHECK-NEXT: <string>Reference count incremented. The object now has a +2 retain count</string>
746 // CHECK-NEXT: <string>Reference count incremented. The object now has a +2 retain count</string>
819 // CHECK-NEXT: <string>Reference count decremented. The object now has a +1 retain count</string>
821 // CHECK-NEXT: <string>Reference count decremented. The object now has a +1 retain count</string>
882 // CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;leaked&apos; is not referenced later in this execution path and has a retain count of +1</string>
884 // CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;leaked&apos; is not referenced later in this execution path and has a retain count of +1</string>
962 // CHECK-NEXT: <string>Property returns an Objective-C object with a +0 retain count</string>
964 // CHECK-NEXT: <string>Property returns an Objective-C object with a +0 retain count</string>
1037 // CHECK-NEXT: <string>Reference count incremented. The object now has a +1 retain count</string>
1039 // CHECK-NEXT: <string>Reference count incremented. The object now has a +1 retain count</string>
1100 // CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;leaked&apos; is not referenced later in this execution path and has a retain count of +1</string>
1102 // CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;leaked&apos; is not referenced later in this execution path and has a retain count of +1</string>
1180 // CHECK-NEXT: <string>Call to function &apos;CFGetSomething&apos; returns a Core Foundation object with a +0 retain count</string>
1182 // CHECK-NEXT: <string>Call to function &apos;CFGetSomething&apos; returns a Core Foundation object with a +0 retain count</string>
1255 // CHECK-NEXT: <string>Reference count incremented. The object now has a +1 retain count</string>
1257 // CHECK-NEXT: <string>Reference count incremented. The object now has a +1 retain count</string>
1318 // CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;leaked&apos; is not referenced later in this execution path and has a retain count of +1</string>
1320 // CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;leaked&apos; is not referenced later in this execution path and has a retain count of +1</string>
1398 // CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
1400 // CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
1616 // CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
1618 // CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
1834 // CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
1836 // CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
2047 // CHECK-NEXT: <string>Object was autoreleased 2 times but the object has a +1 retain count</string>
2049 // CHECK-NEXT: <string>Object was autoreleased 2 times but the object has a +1 retain count</string>
2127 // CHECK-NEXT: <string>Property returns an Objective-C object with a +0 retain count</string>
2129 // CHECK-NEXT: <string>Property returns an Objective-C object with a +0 retain count</string>
2265 // CHECK-NEXT: <string>Object was autoreleased but has a +0 retain count</string>
2267 // CHECK-NEXT: <string>Object was autoreleased but has a +0 retain count</string>
2345 // CHECK-NEXT: <string>Call to function &apos;CFCreateSomething&apos; returns a Core Foundation object with a +1 retain count</string>
2347 // CHECK-NEXT: <string>Call to function &apos;CFCreateSomething&apos; returns a Core Foundation object with a +1 retain count</string>
2558 // CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;leaked&apos; is not referenced later in this execution path and has a retain count of +1</string>
2560 // CHECK-NEXT: <string>Object leaked: object allocated and stored into &apos;leaked&apos; is not referenced later in this execution path and has a retain count of +1</string>
2638 // CHECK-NEXT: <string>Call to function &apos;CFGetSomething&apos; returns a Core Foundation object with a +0 retain count</string>
2640 // CHECK-NEXT: <string>Call to function &apos;CFGetSomething&apos; returns a Core Foundation object with a +0 retain count</string>
2713 // CHECK-NEXT: <string>Object returned to caller with a +0 retain count</string>
2715 // CHECK-NEXT: <string>Object returned to caller with a +0 retain count</string>
2742 // CHECK-NEXT: <string>Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected</string>
2744 // CHECK-NEXT: <string>Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected</string>
2747 // CHECK-NEXT: <key>description</key><string>Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected</string>
2822 // CHECK-NEXT: <string>Call to function &apos;CFCreateSomething&apos; returns a Core Foundation object with a +1 retain count</string>
2824 // CHECK-NEXT: <string>Call to function &apos;CFCreateSomething&apos; returns a Core Foundation object with a +1 retain count</string>
2897 // CHECK-NEXT: <string>Object returned to caller as an owning reference (single retain count transferred to caller)</string>
2899 // CHECK-NEXT: <string>Object returned to caller as an owning reference (single retain count transferred to caller)</string>
3006 // CHECK-NEXT: <string>Property returns an Objective-C object with a +0 retain count</string>
3008 // CHECK-NEXT: <string>Property returns an Objective-C object with a +0 retain count</string>
3081 // CHECK-NEXT: <string>Object returned to caller with a +0 retain count</string>
3083 // CHECK-NEXT: <string>Object returned to caller with a +0 retain count</string>
3110 // CHECK-NEXT: <string>Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected</string>
3112 // CHECK-NEXT: <string>Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected</string>
3115 // CHECK-NEXT: <key>description</key><string>Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected</string>
3190 // CHECK-NEXT: <string>Subscript returns an Objective-C object with a +0 retain count</string>
3192 // CHECK-NEXT: <string>Subscript returns an Objective-C object with a +0 retain count</string>
3265 // CHECK-NEXT: <string>Object returned to caller with a +0 retain count</string>
3267 // CHECK-NEXT: <string>Object returned to caller with a +0 retain count</string>
3294 // CHECK-NEXT: <string>Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected</string>
3296 // CHECK-NEXT: <string>Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected</string>
3299 // CHECK-NEXT: <key>description</key><string>Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected</string>
3374 // CHECK-NEXT: <string>Subscript returns an Objective-C object with a +0 retain count</string>
3376 // CHECK-NEXT: <string>Subscript returns an Objective-C object with a +0 retain count</string>
3449 // CHECK-NEXT: <string>Object returned to caller with a +0 retain count</string>
3451 // CHECK-NEXT: <string>Object returned to caller with a +0 retain count</string>
3478 // CHECK-NEXT: <string>Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected</string>
3480 // CHECK-NEXT: <string>Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected</string>
3483 // CHECK-NEXT: <key>description</key><string>Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected</string>
3558 // CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
3560 // CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
3633 // CHECK-NEXT: <string>Object returned to caller as an owning reference (single retain count transferred to caller)</string>
3635 // CHECK-NEXT: <string>Object returned to caller as an owning reference (single retain count transferred to caller)</string>
3742 // CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
3744 // CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
3880 // CHECK-NEXT: <string>Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected</string>
3882 // CHECK-NEXT: <string>Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected</string>
3885 // CHECK-NEXT: <key>description</key><string>Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected</string>
3960 // CHECK-NEXT: <string>NSNumber literal is an object with a +0 retain count</string>
3962 // CHECK-NEXT: <string>NSNumber literal is an object with a +0 retain count</string>
4103 // CHECK-NEXT: <string>NSNumber boxed expression produces an object with a +0 retain count</string>
4105 // CHECK-NEXT: <string>NSNumber boxed expression produces an object with a +0 retain count</string>
4246 // CHECK-NEXT: <string>NSString boxed expression produces an object with a +0 retain count</string>
4248 // CHECK-NEXT: <string>NSString boxed expression produces an object with a +0 retain count</string>
4389 // CHECK-NEXT: <string>NSArray literal is an object with a +0 retain count</string>
4391 // CHECK-NEXT: <string>NSArray literal is an object with a +0 retain count</string>
4532 // CHECK-NEXT: <string>NSDictionary literal is an object with a +0 retain count</string>
4534 // CHECK-NEXT: <string>NSDictionary literal is an object with a +0 retain count</string>
4675 // CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
4677 // CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
4975 // CHECK-NEXT: <string>Object leaked: allocated object is not referenced later in this execution path and has a retain count of +1</string>
4977 // CHECK-NEXT: <string>Object leaked: allocated object is not referenced later in this execution path and has a retain count of +1</string>
5200 // CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
5202 // CHECK-NEXT: <string>Method returns an Objective-C object with a +1 retain count</string>
5326 // CHECK-NEXT: <string>Object leaked: allocated object is not referenced later in this execution path and has a retain count of +1</string>
5328 // CHECK-NEXT: <string>Object leaked: allocated object is not referenced later in this execution path and has a retain count of +1</string>