[LLVMbugs] [Bug 19746] New: Analyzer doesn't recognize under retain in Obj-C setter

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 14 13:52:18 PDT 2014


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: kremenek at apple.com
          Reporter: seth at freaksw.com
                CC: llvmbugs at cs.uiuc.edu
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140514/053ea1d1/attachment.html>


More information about the llvm-bugs mailing list