http://llvm.org/bugs/show_bug.cgi?id=7309
Summary: Objective-C: Retain-count analysis with property
assignment
Product: clang
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: Static Analyzer
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
This is a bug concerning the dot-syntax assignment with properties:
The following bug should make the CSA display the same diagnosis for both
assignments, it only displays one for the method call and not for the property
assignment.
Code:
#import <Foundation/Foundation.h>
@interface MyClass : NSObject
// retain or assign doesn't change anything
@property(nonatomic, retain) id prop;
@end
int main(int argc, char **argv)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
MyClass *obj = [[[MyClass alloc] init] autorelease];
// This line triggers a possible leak diagnosis
[obj setProp:[[NSObject alloc] init]];
// This line is strictly equivalent but doesn't trigger the leak diagnosis
obj.prop = [[NSObject alloc] init];
[pool drain];
return 0;
}
@implementation MyClass
@synthesize prop;
@end
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs