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

Török Edwin edwintorok at gmail.com
Mon Jun 15 11:43:45 PDT 2009


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.

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

Best regards,
--Edwin



More information about the llvm-commits mailing list