[cfe-commits] r61943 - /cfe/trunk/lib/AST/DeclObjC.cpp

Ted Kremenek kremenek at apple.com
Thu Jan 8 12:55:57 PST 2009


On Jan 8, 2009, at 12:51 PM, Douglas Gregor wrote:

>
> On Jan 8, 2009, at 12:49 PM, Ted Kremenek wrote:
>
>> Author: kremenek
>> Date: Thu Jan  8 14:49:27 2009
>> New Revision: 61943
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=61943&view=rev
>> Log:
>> Fix ObjCInterfaceDecl::Destroy and ObjCProtocolDecl::Destroy to  
>> iterate and destroy all contained ObjCMethodDecls in one sweep.   
>> This fixes a use-after-free error found by valgrind.
>
> I don't think this is right. DeclContext should own the  
> ObjCMethodDecls, and they should be destroyed by  
> DeclContext::DestroyDecls.
>
> 	- Doug

I completely agree, but that's a separate issue.  This patched just  
made the existing logic work correctly because of the way  
instmeth_iterator and classmeth_iterator were changed underneath.



More information about the cfe-commits mailing list