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

Dan Gohman gohman at apple.com
Mon Jun 15 13:23:09 PDT 2009


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.

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

Dan





More information about the llvm-commits mailing list