http://llvm.org/bugs/show_bug.cgi?id=19746

            Bug ID: 19746
           Summary: Analyzer doesn't recognize under retain in Obj-C
                    setter
           Product: clang
           Version: 3.4
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Given the code below, I'd expect the analyzer to tell me I didn't retain or
copy the NSString and have under-retained it.



This is the simplest case:


@interface Foo : NSObject
@property (nonatomic, readwrite, copy) NSString * property;
@end


@implementation Foo
{
    NSString * _property;
}


- (void)dealloc
{
    [_property release];
    [super dealloc];
}


- (void)setProperty:(NSString *)property;
{
    [_property autorelease];
    _property = property;  // should be [property copy]
}


- (NSString *)property;
{
    return _property;
}


@end

-- 
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

Reply via email to