summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2017-04-20 18:29:14 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2017-04-20 18:29:14 +0000
commit58dadd59d94468250109b85737c41650f82409f3 (patch)
tree6ebe63de13777c30e2e8a7406c732e257ec3e75a /llvm/lib/CodeGen
parent938fc1341d7f430cf3dad5e67704883b01e876c4 (diff)
downloadbcm5719-llvm-58dadd59d94468250109b85737c41650f82409f3.tar.gz
bcm5719-llvm-58dadd59d94468250109b85737c41650f82409f3.zip
Fix use-after-frees on memory allocated in a Recycler.
This will become asan errors once the patch lands that poisons the memory after free. The x86 change is a hack, but I don't see how to solve this properly at the moment. llvm-svn: 300867
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/Legalizer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp b/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
index 2160a8255bc..74ed58e8d04 100644
--- a/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
@@ -223,7 +223,11 @@ bool Legalizer::runOnMachineFunction(MachineFunction &MF) {
// good chance MI will be deleted.
NextMI = std::next(MI);
- Changed |= combineExtracts(*MI, MRI, TII);
+ // combineExtracts erases MI.
+ if (combineExtracts(*MI, MRI, TII)) {
+ Changed = true;
+ continue;
+ }
Changed |= combineMerges(*MI, MRI, TII);
}
}
OpenPOWER on IntegriCloud