]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] cmd/compile: fix -G=3 handling of blank methods
authorMatthew Dempsky <mdempsky@google.com>
Mon, 25 Jan 2021 07:31:25 +0000 (23:31 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 25 Jan 2021 17:07:38 +0000 (17:07 +0000)
Fixes "GO_GCFLAGS=-G=3 go run run.go -- blank.go interface/fail.go".

Change-Id: I669ab06ae29366ce96e2948c89a5c1620afd53db
Reviewed-on: https://go-review.googlesource.com/c/go/+/286214
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
src/cmd/compile/internal/noder/object.go

index 95670421566f5ed73a2aafd3d0c1367319b64348..c740285ca2ea3bca7dac8621c58270e2fada613d 100644 (file)
@@ -79,7 +79,10 @@ func (g *irgen) obj(obj types2.Object) *ir.Name {
                        }
                        typ = g.typ(sig)
                } else {
-                       sym = ir.MethodSym(g.typ(recv.Type()), g.selector(obj))
+                       sym = g.selector(obj)
+                       if !sym.IsBlank() {
+                               sym = ir.MethodSym(g.typ(recv.Type()), sym)
+                       }
                        typ = g.signature(g.param(recv), sig)
                }
                name = g.objCommon(pos, ir.ONAME, sym, ir.PFUNC, typ)