[cfe-commits] r52051 - in /cfe/trunk/lib/AST: DeclObjC.cpp TranslationUnit.cpp

Ted Kremenek kremenek at apple.com
Fri Jun 6 10:41:16 PDT 2008


On Jun 6, 2008, at 10:31 AM, Fariborz Jahanian wrote:

>
> On Jun 6, 2008, at 10:21 AM, Ted Kremenek wrote:
>
>> Author: kremenek
>> Date: Fri Jun  6 12:21:42 2008
>> New Revision: 52051
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=52051&view=rev
>> Log:
>> Because of a lack of a clear ownership role between  
>> ObjCInterfaceDecls and
>> ObjCPropertyDecls, have TranslationUnit destroy ObjCPropertyDecls.  
>> This is a
>
> I am not sure what you meant by ownership role? ObjCInterfaceDecls  
> has the list of properties declared for the class. This is no  
> different than ivars, methods, etc.
>
> - Fariborz


 From what I can tell, the PropertyDecls array in ObjCInterfaceDecl  
contains both ObjCPropertyDecls created for the specific class as well  
as the ObjCPropertyDecls in the parent class.  I may be mistaken about  
this, but when I tried to simply destroy ObjCPropertyDecls when  
iterating over the PropertyDecls array I get double-free errors (a  
test case failed in the test suite).  With this horrible hack (having  
TranslationUnit keep track of the ObjCPropertyDecls released), the  
error goes away.  The only way that should make a difference is if two  
ObjCInterfaceDecls have references to the same ObjCPropertyDecl, which  
implies a lack of a clear ownership policy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20080606/26802d39/attachment.html>


More information about the cfe-commits mailing list