mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-31 09:22:31 +00:00
[AArch64] Remove a use-after-free when collecting stats.
The call to mergePairedInsns() deletes MI, so the later use by isUnscaledLdSt() is referencing freed memory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246033 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
80708ae0d8
commit
cd619e4031
@ -984,15 +984,15 @@ bool AArch64LoadStoreOpt::optimizeBlock(MachineBasicBlock &MBB) {
|
||||
MachineBasicBlock::iterator Paired =
|
||||
findMatchingInsn(MBBI, Flags, ScanLimit);
|
||||
if (Paired != E) {
|
||||
++NumPairCreated;
|
||||
if (isUnscaledLdSt(MI))
|
||||
++NumUnscaledPairCreated;
|
||||
|
||||
// Merge the loads into a pair. Keeping the iterator straight is a
|
||||
// pain, so we let the merge routine tell us what the next instruction
|
||||
// is after it's done mucking about.
|
||||
MBBI = mergePairedInsns(MBBI, Paired, Flags);
|
||||
|
||||
Modified = true;
|
||||
++NumPairCreated;
|
||||
if (isUnscaledLdSt(MI))
|
||||
++NumUnscaledPairCreated;
|
||||
break;
|
||||
}
|
||||
++MBBI;
|
||||
|
Loading…
x
Reference in New Issue
Block a user