]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj/s390x: fix potential recursive String call
authorMichael Anthony Knyszek <mknyszek@google.com>
Thu, 29 May 2025 19:04:08 +0000 (19:04 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 29 May 2025 19:49:45 +0000 (12:49 -0700)
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>

src/cmd/internal/obj/s390x/condition_code.go

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