http://llvm.org/bugs/show_bug.cgi?id=4398

           Summary: passManager should always call releaseMemory to avoid
                    use-after-free bugs
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


Currently some passes call releaseMemory (or their equivalent) in their run
function, some don't (for example ScalarEvolution).

According to the documentation "This method is called after the run* method for
the class, before the next call of run* in your pass." 

However the PassManager doesn't do this for on-the-fly passes, which can cause
use-after-free bugs if you are using ScalarEvolution from a ModulePass 
(LoopInfo is rerun, but ScalarEvolution still has stale data from the previous
LoopInfo run).

As discusses on llvm-commits the following should happen:
 - PassManager should call releaseMemory for on-the-fly passes too
 - PassManager should assert if it forgot to call releaseMemory
 - passes that have a releaseMemory equivalent should have the method renamed
to releaseMemory
 - passes should no longer call releaseMemory in their run function


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to