Skip to content

Commit

Permalink
[AArch64] Make opcode switch in tryARM64PackedUnwind comprehensive.
Browse files Browse the repository at this point in the history
I don't think compiler-generated code could actually be affected by
this, but better to be thorough.

Differential Revision: https://reviews.llvm.org/D139048
  • Loading branch information
efriedma-quic committed Dec 1, 2022
1 parent dd8d0d2 commit e65c5ee
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions llvm/lib/MC/MCWin64EH.cpp
Expand Up @@ -999,6 +999,23 @@ static bool tryARM64PackedUnwind(WinEH::FrameInfo *info, uint32_t FuncLength,
// These are never canonical; they don't show up with the usual Arm64
// calling convention.
return false;
case Win64EH::UOP_AllocLarge:
// Allocations this large can't be represented in packed unwind (and
// usually don't fit the canonical form anyway because we need to use
// __chkstk to allocate the stack space).
return false;
case Win64EH::UOP_AddFP:
// "add x29, sp, #N" doesn't show up in the canonical pattern (except for
// N=0, which is UOP_SetFP).
return false;
case Win64EH::UOP_TrapFrame:
case Win64EH::UOP_Context:
case Win64EH::UOP_ClearUnwoundToCall:
case Win64EH::UOP_PushMachFrame:
// These are special opcodes that aren't normally generated.
return false;
default:
report_fatal_error("Unknown Arm64 unwind opcode");
}
}
if (RegI > 10 || RegF > 8)
Expand Down

0 comments on commit e65c5ee

Please sign in to comment.