[llvm] [AArch64][WinCFI] Fix a crash due to missing seh directives (PR #123993)

Hiroshi Yamauchi via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 11:44:55 PST 2025


================
@@ -1513,16 +1506,27 @@ static MachineBasicBlock::iterator convertCalleeSaveRestoreToSPPrePostIncDec(
       CSStackSizeInc > MaxOffset * (int64_t)Scale.getFixedValue()) {
     // If we are destroying the frame, make sure we add the increment after the
     // last frame operation.
-    if (FrameFlag == MachineInstr::FrameDestroy)
+    if (FrameFlag == MachineInstr::FrameDestroy) {
       ++MBBI;
+      // Also skip the SEH instruction, if needed
----------------
hjyamauchi wrote:

This addition skip logic was needed to skip two instructions (the load/store and its seh instruction pair). Otherwise, the following `emitFrameOffset` call would add the seh instruction at a wrong position (it should add it afterthe load/store and its seh, not between the two).

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


More information about the llvm-commits mailing list