[llvm] [MachineBasicBlock] Fix use after free in SplitCriticalEdge (PR #66188)

Carl Ritson via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 00:58:05 PDT 2023


================
@@ -693,15 +693,15 @@ void MachineBasicBlock::updateTerminator(
   MachineBasicBlock *TBB = nullptr, *FBB = nullptr;
   SmallVector<MachineOperand, 4> Cond;
   DebugLoc DL = findBranchDebugLoc();
-  bool B = TII->analyzeBranch(*this, TBB, FBB, Cond);
+  bool B = TII->analyzeBranch(*this, TBB, FBB, Cond, /*AllowModify=*/false);
----------------
perlfu wrote:

This is NFC, but I felt it was appropriate to add an explicit configuration of AllowModify=false here as SlotIndexes will be invalidated if analyzeBranch modifies the instructions.

https://github.com/llvm/llvm-project/pull/66188


More information about the llvm-commits mailing list