mirror of
https://github.com/danog/ir.git
synced 2024-11-30 04:39:43 +01:00
Fix EXITCALL code for WIN64 (support for home/shadow space)
This commit is contained in:
parent
e88b6ab92d
commit
5e13d47e38
@ -7062,6 +7062,9 @@ static void ir_emit_exitcall(ir_ctx *ctx, ir_ref def, ir_insn *insn)
|
|||||||
| mov Ra(IR_REG_INT_ARG2), rsp
|
| mov Ra(IR_REG_INT_ARG2), rsp
|
||||||
| mov aword [rsp+4*8], Ra(IR_REG_INT_ARG2)
|
| mov aword [rsp+4*8], Ra(IR_REG_INT_ARG2)
|
||||||
| mov Ra(IR_REG_INT_ARG1), [rsp+16*8+16*8+8]
|
| mov Ra(IR_REG_INT_ARG1), [rsp+16*8+16*8+8]
|
||||||
|
|.if X64WIN
|
||||||
|
| sub rsp, 32 /* shadow space */
|
||||||
|
|.endif
|
||||||
|.else
|
|.else
|
||||||
| sub esp, 8*4+8*8+12 /* CPU regs + SSE regs */
|
| sub esp, 8*4+8*8+12 /* CPU regs + SSE regs */
|
||||||
| mov aword [esp+0*4], eax
|
| mov aword [esp+0*4], eax
|
||||||
@ -7105,7 +7108,9 @@ static void ir_emit_exitcall(ir_ctx *ctx, ir_ref def, ir_insn *insn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// restore SP
|
// restore SP
|
||||||
|.if X64
|
|.if X64WIN
|
||||||
|
| add rsp, 32+16*8+16*8+16 /* shadow space + CPU regs + SSE regs */
|
||||||
|
|.elif X64
|
||||||
| add rsp, 16*8+16*8+16 /* CPU regs + SSE regs */
|
| add rsp, 16*8+16*8+16 /* CPU regs + SSE regs */
|
||||||
|.else
|
|.else
|
||||||
| add esp, 8*4+8*8+16 /* CPU regs + SSE regs */
|
| add esp, 8*4+8*8+16 /* CPU regs + SSE regs */
|
||||||
|
Loading…
Reference in New Issue
Block a user