cmd/internal/obj/s390x: fix potential recursive String call

This String method can potentially recurse infinitely, since %#x will
apparently call String if the method exists. This isn't well documented,
but cmd/vet will be updated soon to check this (when we update the
vendored x/tools dependency) so cut off the recursion by converting to
the underlying type first.

Change-Id: Ia6fc046c9eb56a5dd6a33772afd23da443a06116
Reviewed-on: https://go-review.googlesource.com/c/go/+/677261
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Michael Anthony Knyszek 2025-05-29 19:04:08 +00:00 committed by Gopher Robot
parent 21b7e60c6b
commit 9f3dd846e2

View file

@ -122,7 +122,7 @@ func (c CCMask) String() string {
} }
// invalid // invalid
return fmt.Sprintf("Invalid (%#x)", c) return fmt.Sprintf("Invalid (%#x)", uint8(c))
} }
func (CCMask) CanBeAnSSAAux() {} func (CCMask) CanBeAnSSAAux() {}