[LLVMbugs] [Bug 8123] New: -init always treated as release, even when you can prove it isn't.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 9 15:45:29 PDT 2010


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

           Summary: -init always treated as release, even when you can
                    prove it isn't.
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: csdavec at swan.ac.uk
                CC: llvmbugs at cs.uiuc.edu


The analyser generates this:

          obj = [c allocWithZone: zone];
- 6 Method returns an Objective-C object with a +1 retain count (owning
reference)
655              GSIArrayAddItem(objMap, (GSIArrayItem)obj);
656     
657              rep = [obj initWithCoder: self];
- 7 Object released
658              if (rep != obj)
-8 Taking false branch
659                {
660                  obj = rep;
661                  GSIArraySetItemAtIndex(objMap, (GSIArrayItem)obj, xref);
662                }
663     
664              rep = [obj awakeAfterUsingCoder: self];
-9 Reference-counted object is used after it is released

The false branch is taken if rep == obj.  In this case, obj is not used after
being released, because obj is rep, therefore obj was not released.

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