Skip to content
Snippets Groups Projects
Commit 8ff45d1a authored by Keith Randall's avatar Keith Randall Committed by Carlos Amedee
Browse files

[release-branch.go1.23] runtime: fix 9-arg syscall on darwin/amd64

The last 3 arguments need to be passed on the stack, not registers.

Fixes #73380

Change-Id: Ib1155ad1a805957fad3d9594c93981a558755591
Reviewed-on: https://go-review.googlesource.com/c/go/+/665435


Reviewed-by: default avatarMichael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: default avatarKeith Randall <khr@google.com>
(cherry picked from commit 9d7de048)
Reviewed-on: https://go-review.googlesource.com/c/go/+/666015
parent 96537d50
No related branches found
No related tags found
No related merge requests found
......@@ -739,7 +739,7 @@ ok:
//
// syscall9 expects a 32-bit result and tests for 32-bit -1
// to decide there was an error.
TEXT runtime·syscall9(SB),NOSPLIT,$16
TEXT runtime·syscall9(SB),NOSPLIT,$32
MOVQ (0*8)(DI), R13// fn
MOVQ (2*8)(DI), SI // a2
MOVQ (3*8)(DI), DX // a3
......@@ -747,15 +747,18 @@ TEXT runtime·syscall9(SB),NOSPLIT,$16
MOVQ (5*8)(DI), R8 // a5
MOVQ (6*8)(DI), R9 // a6
MOVQ (7*8)(DI), R10 // a7
MOVQ R10, 0(SP)
MOVQ (8*8)(DI), R11 // a8
MOVQ R11, 8(SP)
MOVQ (9*8)(DI), R12 // a9
MOVQ DI, (SP)
MOVQ R12, 16(SP)
MOVQ DI, 24(SP)
MOVQ (1*8)(DI), DI // a1
XORL AX, AX // vararg: say "no float args"
CALL R13
MOVQ (SP), DI
MOVQ 24(SP), DI
MOVQ AX, (10*8)(DI) // r1
MOVQ DX, (11*8)(DI) // r2
......@@ -764,7 +767,7 @@ TEXT runtime·syscall9(SB),NOSPLIT,$16
CALL libc_error(SB)
MOVLQSX (AX), AX
MOVQ (SP), DI
MOVQ 24(SP), DI
MOVQ AX, (12*8)(DI) // err
ok:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment