llvm.org GIT mirror llvm / 1c26722
Merging r332176: ------------------------------------------------------------------------ r332176 | dim | 2018-05-12 12:59:54 -0700 (Sat, 12 May 2018) | 20 lines Clear converters map after X86 Domain Reassignment to avoid crashes Summary: As reported in PR37264, in some cases the X86 Domain Reassignment `runOnMachineFunction()` is called twice. Because it only deletes the `.second` members of its `InstrConverterBaseMap`, and does not clean up the map itself, this can lead to double frees and crashes. Use `DeleteContainerSeconds()` instead, so the `Converters` map can safely be reinitialized and its members re-deleted for each X86 Domain Reassignment pass. Reviewers: guyblank, craig.topper Reviewed By: craig.topper Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46425 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_60@332263 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 2 years ago
1 changed file(s) with 1 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
749749 Changed = true;
750750 }
752 for (auto I : Converters)
753 delete I.second;
752 DeleteContainerSeconds(Converters);
755754 DEBUG(dbgs() << "***** Machine Function after Domain Reassignment *****\n");
756755 DEBUG(MF.print(dbgs()));