]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] cmd/compile: fix wrong AST generation in devirtualization
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Sat, 26 Jun 2021 06:57:51 +0000 (13:57 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Sat, 26 Jun 2021 08:23:09 +0000 (08:23 +0000)
CL 330671 moved rewrite method calls to escape analysis. It accidently
made the AST invalid, by removing the OCALLMETH set operation during
devirtualization pass.

Change-Id: I862ffd7f880de55969d7784d9e7b3c38894f6b68
Reviewed-on: https://go-review.googlesource.com/c/go/+/330832
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/devirtualize/devirtualize.go

index f52499e07f660a0ff0182edcad756d52cb7487d7..60ba208d0876b119d74e10e33d0103c97fee5c8c 100644 (file)
@@ -50,6 +50,7 @@ func Call(call *ir.CallExpr) {
                if base.Flag.LowerM != 0 {
                        base.WarnfAt(call.Pos(), "devirtualizing %v to %v", sel, typ)
                }
+               call.SetOp(ir.OCALLMETH)
                call.X = x
        case ir.ODOTINTER:
                // Promoted method from embedded interface-typed field (#42279).