[llvm-commits] [PATCH] Avoid use after free in ScalarEvolution

Török Edwin edwintorok at gmail.com
Tue Jun 16 00:19:32 PDT 2009


On 2009-06-15 23:23, Dan Gohman wrote:
> On Jun 15, 2009, at 11:43 AM, Török Edwin wrote:
>
>
>   
>> On 2009-06-15 21:15, Dan Gohman wrote:
>>
>>     
>>> Hi Edwin,
>>>
>>>
>>>
>>> WritingAnLLVMPass.htm's description of releaseMemory says "This  
>>> method
>>>
>>> is
>>>
>>> called after the run* method for the class, before the next call of  
>>> run*
>>>
>>> in your pass."  This suggests that it's a bug in the PassManager  
>>> for not
>>>
>>> calling releaseMemory for on-the-fly analyses.
>>>
>>>
>>>
>>>       
>> Would it be OK with you if I file a PR, and then try to provide a  
>> patch
>> to do that?
>> And also add an assertion before calling run() that checks that
>> releaseMemory was called.
>>     
>
> Sounds good to me.
>   

I opened PR4398.

>   
>>     
>>> On the other hand, I do see several other existing passes calling
>>>
>>> releaseMemory or the equivalent at the top of their run functions.
>>>
>>>
>>>
>>>       
>> If the passmanager will properly call releaseMemory, could we patch  
>> them
>> not to do that?
>> (And for passes that have a releaseMemory equivalent that isn;'t  
>> called
>> that, rename it).
>>     
>
> Sure.
>   

Thanks,
--Edwin




More information about the llvm-commits mailing list