mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-31 12:35:51 +00:00
In a leaf without a frame pointer, --frame-red-zone lowers RSP after the prologue and adds the shift to every RSP operand in the body, assuming RSP does not move between the prologue and the exits. It refused explicit RSP arithmetic but not opcode-encoded pushes and pops, so after "push rax" in the body the read of the pushed slot at [rsp] became [rsp+0x10], a red-zone slot, and "pushfq; and qword [rsp], -2; popfq" changed that slot instead of the saved flags. Such a leaf now keeps its red zone and is reported as "push or pop inside the body": push and pop of a register, push imm, push r/m, pop r/m, pushf, popf and push or pop of fs or gs outside the exits. The pops of an exit still frame, and leaves with a frame pointer, whose RSP operands are already refused, still frame when they push and pop.