From 942bcc2d4f4e66b617c225aed1ba4d4d42a08ed2 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Sat, 26 Jun 2021 13:57:51 +0700 Subject: [PATCH] [dev.typeparams] cmd/compile: fix wrong AST generation in devirtualization 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 Run-TryBot: Cuong Manh Le TryBot-Result: Go Bot Reviewed-by: Matthew Dempsky --- src/cmd/compile/internal/devirtualize/devirtualize.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd/compile/internal/devirtualize/devirtualize.go b/src/cmd/compile/internal/devirtualize/devirtualize.go index f52499e07f6..60ba208d087 100644 --- a/src/cmd/compile/internal/devirtualize/devirtualize.go +++ b/src/cmd/compile/internal/devirtualize/devirtualize.go @@ -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).