aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/internal
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2022-09-17 02:21:12 +0000
committerGopher Robot <gobot@golang.org>2022-09-17 02:56:51 +0000
commitcc1b20e8adf83865a1dbffa259c7a04ef0699b43 (patch)
tree69dcee61895e9225cfe4e452476f2bc2003b9c14 /src/runtime/internal
parent1c19c5602bc5d5f54463b1a0133965fa25ebcd56 (diff)
downloadgo-cc1b20e8adf83865a1dbffa259c7a04ef0699b43.tar.xz
runtime/internal/sys: make Len64 nosplit
CL 427615 causes failures when Len64 can't be inlined. It's unclear to me why this wasn't a problem before, but it is used in sensitive contexts and therefore really should be marked. Confirmed that the failures in question reproduce without this change, and don't reproduce with it. Fixes #55117. Change-Id: Ic3aa96af1420cc0c39551908d83f954725c712f5 Reviewed-on: https://go-review.googlesource.com/c/go/+/431058 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/runtime/internal')
-rw-r--r--src/runtime/internal/sys/intrinsics_common.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/internal/sys/intrinsics_common.go b/src/runtime/internal/sys/intrinsics_common.go
index 48d9759ca9..7d7af20906 100644
--- a/src/runtime/internal/sys/intrinsics_common.go
+++ b/src/runtime/internal/sys/intrinsics_common.go
@@ -45,6 +45,10 @@ var ntz8tab = [256]uint8{
}
// len64 returns the minimum number of bits required to represent x; the result is 0 for x == 0.
+//
+// nosplit because this is used in src/runtime/histogram.go, which make run in sensitive contexts.
+//
+//go:nosplit
func Len64(x uint64) (n int) {
if x >= 1<<32 {
x >>= 32