]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/internal/sys: make Len64 nosplit
authorMichael Anthony Knyszek <mknyszek@google.com>
Sat, 17 Sep 2022 02:21:12 +0000 (02:21 +0000)
committerGopher Robot <gobot@golang.org>
Sat, 17 Sep 2022 02:56:51 +0000 (02:56 +0000)
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>

src/runtime/internal/sys/intrinsics_common.go

index 48d9759ca9c54c77074cd98a8506fb3b24230b70..7d7af20906790b57bfff828b9480ac494fb49869 100644 (file)
@@ -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