Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 1c26722

Browse files
committed
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
1 parent 5ac981f commit 1c26722

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/Target/X86/X86DomainReassignment.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,7 @@ bool X86DomainReassignment::runOnMachineFunction(MachineFunction &MF) {
750750
Changed = true;
751751
}
752752

753-
for (auto I : Converters)
754-
delete I.second;
753+
DeleteContainerSeconds(Converters);
755754

756755
DEBUG(dbgs() << "***** Machine Function after Domain Reassignment *****\n");
757756
DEBUG(MF.print(dbgs()));

0 commit comments

Comments
 (0)