<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 6, 2008, at 10:41 AM, Ted Kremenek wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 6, 2008, at 10:31 AM, Fariborz Jahanian wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><br>On Jun 6, 2008, at 10:21 AM, Ted Kremenek wrote:<br><br><blockquote type="cite">Author: kremenek<br></blockquote><blockquote type="cite">Date: Fri Jun  6 12:21:42 2008<br></blockquote><blockquote type="cite">New Revision: 52051<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=52051&view=rev">http://llvm.org/viewvc/llvm-project?rev=52051&view=rev</a><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">Because of a lack of a clear ownership role between ObjCInterfaceDecls and<br></blockquote><blockquote type="cite">ObjCPropertyDecls, have TranslationUnit destroy ObjCPropertyDecls. This is a<br></blockquote><br>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.<br><br>- Fariborz</span></blockquote></div><div><br></div>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 </div></blockquote><div><br class="webkit-block-placeholder"></div><div>We are merging properties declared in class's protocol into those for current class. Look at:</div><div><br class="webkit-block-placeholder"></div><div>/// MergeOneProtocolPropertiesIntoClass - This routine goes thru the list</div><div>/// of properties declared in a protocol and adds them to the list</div><div>/// of properties for current class if it is not there already.</div><div>void</div><div>Sema::MergeOneProtocolPropertiesIntoClass(ObjCInterfaceDecl *IDecl,</div><div>                                          ObjCProtocolDecl *PDecl)</div><div><br class="webkit-block-placeholder"></div><div>- fariborz</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">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.</div></blockquote></div><br></body></html>