[LLVMbugs] [Bug 14927] New: static analyzer false positive; treats -drain like -release

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jan 11 16:25:41 PST 2013


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

             Bug #: 14927
           Summary: static analyzer false positive; treats -drain like
                    -release
           Product: clang
           Version: unspecified
          Platform: Macintosh
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: lindberg+llvm at clindberg.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


The analyzer is reporting a problem with code like:

  [[SomeCustomClass sharedInstance] drain];

It reports "Incorrect decrement of the reference count of an object that is not
owned at this point by the caller."  That seems like the message for an
inappropriate -release call.  While that makes perfect sense for
NSAutoreleasePool objects, it does not make sense for anything else -- the
special -drain method which acts like release is not a generic NSObject method
but is specific to NSAutoreleasePool.  Generating a warning in any other case
would seem to be a false positive.  (In this case, the -drain method is a
method implemented on the class in question, which has nothing to do with ObjC
reference counts.)

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



More information about the llvm-bugs mailing list