]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix method set computation for shadowed methods
authorMatthew Dempsky <mdempsky@google.com>
Tue, 27 Mar 2018 08:05:48 +0000 (01:05 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 27 Mar 2018 18:56:36 +0000 (18:56 +0000)
commit7b177b1a03c2f519bb5e52eb4471a1e2580f6db9
tree69c949ca46404d30ee2bf2a081a8986b5ad9b125
parent6e59c73a9fe4eab3e09c6287f69c48837580dbb4
cmd/compile: fix method set computation for shadowed methods

In expandmeth, we call expand1/expand0 to build a list of all
candidate methods to promote, and then we use dotpath to prune down
which names actually resolve to a promoted method and how.

However, previously we still computed "followsptr" based on the
expand1/expand0 traversal (which is depth-first), rather than
dotpath (which is breadth-first). The result is that we could
sometimes end up miscomputing whether a particular promoted method
involves a pointer traversal, which could result in bad code
generation for method trampolines.

Fixes #24547.

Change-Id: I57dc014466d81c165b05d78b98610dc3765b7a90
Reviewed-on: https://go-review.googlesource.com/102618
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/subr.go
test/fixedbugs/issue24547.go [new file with mode: 0644]