Commit 639cb1b6 authored by Austin Clements's avatar Austin Clements
Browse files

runtime: mark stdcallN functions cgo_unsafe_args

These functions take the address of an argument and expect to be able
to reach later arguments from that pointer. This means they must be
laid out sequentially in memory (using ABI0) and all arguments must be
live even though they don't all appear to be referenced. This is
exactly what go:cgo_unsafe_args does.

Without this, GOEXPERIMENT=regabi,regabiargs on windows/amd64 crashes
on runtime startup because the stdcall functions are called with their
arguments in registers, so taking the address of one of them has no
bearing on the memory locations of the following arguments.

With this, GOEXPERIMENT=regabi,regabiargs on windows/amd64 passes
all.bash.

For #40724.

Change-Id: I4a4d6a913f85799b43f61c234d21ebb113a9b527
Reviewed-on: https://go-review.googlesource.com/c/go/+/310733


Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: default avatarMichael Knyszek <mknyszek@google.com>
Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
parent 0613c748
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment