[llvm] [Windows SEH] fix failed assert and crash (PR #107031)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 3 22:07:01 PDT 2024


================
@@ -1476,6 +1476,11 @@ void SelectionDAGISel::reportIPToStateForBlocks(MachineFunction *MF) {
     if (BB->getFirstMayFaultInst()) {
       // Report IP range only for blocks with Faulty inst
       auto MBBb = MBB.getFirstNonPHI();
+
+      // Avoids attempting to dereference a sentintel which fails an assert
+      if (MBBb == MBB.instr_end())
----------------
arsenm wrote:

Just use .end, not instr_end 

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


More information about the llvm-commits mailing list