]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: fix the test for ABI specification so it works right w/ generics
authorDavid Chase <drchase@google.com>
Tue, 8 Apr 2025 01:38:01 +0000 (11:38 +1000)
committerDavid Chase <drchase@google.com>
Wed, 9 Apr 2025 07:32:10 +0000 (00:32 -0700)
Change-Id: I09ef615bfe69a30fa8f7eef5f0a8ff94a244c920
Reviewed-on: https://go-review.googlesource.com/c/go/+/663776
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/cmd/compile/internal/ssagen/ssa.go

index b7a9b7bea42eec32b37c18564067bbb4d5162289..b0e0262d450e201b813ae53008329dfad05bf0a2 100644 (file)
@@ -317,7 +317,7 @@ func buildssa(fn *ir.Func, worker int, isPgoHot bool) *ssa.Func {
        // optionally allows an ABI suffix specification in the GOSSAHASH, e.g. "(*Reader).Reset<0>" etc
        if strings.Contains(ssaDump, name) { // in all the cases the function name is entirely contained within the GOSSAFUNC string.
                nameOptABI := name
-               if strings.Contains(ssaDump, ",") { // ABI specification
+               if l := len(ssaDump); l > 1 && ssaDump[l-2] == ',' { // ABI specification
                        nameOptABI = ssa.FuncNameABI(name, abiSelf.Which())
                } else if strings.HasSuffix(ssaDump, ">") { // if they use the linker syntax instead....
                        l := len(ssaDump)