[MC] [Win64EH] Fix the calculation of the end of epilogs
Exclude the terminating end opcode from the epilog - it doesn't correspond to an actual instruction that is included in the epilog itself (within the .seh_startepilogue/.seh_endepilogue range). In most (all?) cases, an epilog is followed by a matching terminating instruction though (a ret or a branch to a tail call), but it's not strictly within the .seh_startepilogue/.seh_endepilogue range. This fixes a number of failed asserts in cases where the codegen has incorrectly reoredered SEH opcodes so they don't match up exactly with their instructions. However this still just avoids failing the assertion; the root cause of generating unexpected epilogs is still present (and fixing that is a less obvious issue). Differential Revision: https://reviews.llvm.org/D131393
Loading
Please sign in to comment