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

             Bug #: 11870
           Summary: false positive leak checking for objects in collection
                    classes
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


checker claims there is a leak in this piece of code although there obviously
isn't:

        NSObject *o = [[NSObject alloc] init];
        NSArray *a = [[NSArray alloc] initWithObjects:o, nil];

        for (NSObject *i in a)
            [i release];

        [a release];




main.m:15:23: warning: Potential leak of an object allocated on line 15 and
stored into 'o'
         NSObject *o = [[NSObject alloc] init];
                       ^
1 warning generated.

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

Reply via email to