aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/export_test.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2021-03-09 21:13:34 +0000
committerMichael Knyszek <mknyszek@google.com>2021-03-31 20:09:03 +0000
commit44dd06670f522e66e7ebfa0bffe14d2b44c93ff8 (patch)
treea500571cac57e12a39da3b138acf0c2a8f50e1eb /src/runtime/export_test.go
parentcb42e3e979830ccaac72d02512f522a820c6a5e7 (diff)
downloadgo-44dd06670f522e66e7ebfa0bffe14d2b44c93ff8.tar.gz
go-44dd06670f522e66e7ebfa0bffe14d2b44c93ff8.zip
runtime: support register ABI Go functions from Windows callbacks
This change modifies the system that allows Go functions to be set as callbacks in various Windows systems to support the new register ABI. For #40724. Change-Id: Ie067f9e8a76c96d56177d7aa88f89cbe7223e12e Reviewed-on: https://go-review.googlesource.com/c/go/+/300113 Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> Trust: Michael Knyszek <mknyszek@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/runtime/export_test.go')
-rw-r--r--src/runtime/export_test.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go
index 961c1c1a26..81200da915 100644
--- a/src/runtime/export_test.go
+++ b/src/runtime/export_test.go
@@ -1233,7 +1233,9 @@ func (th *TimeHistogram) Record(duration int64) {
func SetIntArgRegs(a int) int {
lock(&finlock)
old := intArgRegs
- intArgRegs = a
+ if a >= 0 {
+ intArgRegs = a
+ }
unlock(&finlock)
return old
}