From 52fea4b3d97f741162a38e007aa7cdb5aaf52722 Mon Sep 17 00:00:00 2001 From: Adin Scannell Date: Thu, 23 Feb 2023 22:22:29 +0000 Subject: [PATCH] runtime: fix linkname signature for godebug This signature uses the wrong type for the passed function, which will be saved in the internal runtime map. Since the functions are likely compatible (uint64 return versus int64), this may work but should generally be fixed. This is other instance of #58440. Change-Id: Ied82e554745ef72eefeb5be540605809ffa06533 Reviewed-on: https://go-review.googlesource.com/c/go/+/470915 Reviewed-by: Michael Pratt Run-TryBot: Michael Pratt TryBot-Result: Gopher Robot Auto-Submit: Michael Pratt --- src/internal/godebug/godebug.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/internal/godebug/godebug.go b/src/internal/godebug/godebug.go index 443868c384..fc6fcb92e2 100644 --- a/src/internal/godebug/godebug.go +++ b/src/internal/godebug/godebug.go @@ -45,7 +45,7 @@ type Setting struct { type setting struct { value atomic.Pointer[string] nonDefaultOnce sync.Once - nonDefault atomic.Int64 + nonDefault atomic.Uint64 } // New returns a new Setting for the $GODEBUG setting with the given name. @@ -145,7 +145,7 @@ func setUpdate(update func(string, string)) // It forwards registrations to runtime/metrics. // //go:linkname registerMetric -func registerMetric(name string, read func() int64) +func registerMetric(name string, read func() uint64) // setNewNonDefaultInc is provided by package runtime. // The runtime can do -- 2.50.0