mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
fix memory leak in pass manager when adding an analysis pass that already existed. as pass manager takes ownership of the added passes, it has to delete the pass if it isnt added to the pass list
tweak the opt tool so that it doesnt access a Pass after the ownership was taken by the pass manager git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58730 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -458,8 +458,10 @@ void PMTopLevelManager::schedulePass(Pass *P) {
|
||||
// generate the analysis again. Stale analysis info should not be
|
||||
// available at this point.
|
||||
if (P->getPassInfo() &&
|
||||
P->getPassInfo()->isAnalysis() && findAnalysisPass(P->getPassInfo()))
|
||||
P->getPassInfo()->isAnalysis() && findAnalysisPass(P->getPassInfo())) {
|
||||
delete P;
|
||||
return;
|
||||
}
|
||||
|
||||
AnalysisUsage *AnUsage = findAnalysisUsage(P);
|
||||
|
||||
|
Reference in New Issue
Block a user