From 44dd06670f522e66e7ebfa0bffe14d2b44c93ff8 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Tue, 9 Mar 2021 21:13:34 +0000 Subject: 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 Reviewed-by: Cherry Zhang Trust: Michael Knyszek Run-TryBot: Michael Knyszek TryBot-Result: Go Bot --- src/runtime/export_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/runtime/export_test.go') 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 } -- cgit v1.3-5-g9baa