From: Mateusz Poliwczak Date: Sun, 12 Oct 2025 09:24:32 +0000 (+0200) Subject: cmd/compile/internal/devirtualize: do not track assignments to non-PAUTO X-Git-Tag: go1.26rc1~623 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4dbf1a5a4c8cdb4233d17cc4fa1ca8865add6ac5;p=gostls13.git cmd/compile/internal/devirtualize: do not track assignments to non-PAUTO We do not lookup/devirtualize such, so we can skip tracking them. Change-Id: I8bdb0b11c694e4b2326c236093508a356a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/711160 Reviewed-by: Keith Randall Auto-Submit: Keith Randall Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Reviewed-by: Keith Randall --- diff --git a/src/cmd/compile/internal/devirtualize/devirtualize.go b/src/cmd/compile/internal/devirtualize/devirtualize.go index dfcdd42236..cb4608a024 100644 --- a/src/cmd/compile/internal/devirtualize/devirtualize.go +++ b/src/cmd/compile/internal/devirtualize/devirtualize.go @@ -387,6 +387,9 @@ func (s *State) assignments(n *ir.Name) []assignment { if fun == nil { base.FatalfAt(n.Pos(), "n.Curfn = ") } + if n.Class != ir.PAUTO { + base.FatalfAt(n.Pos(), "n.Class = %v; want = PAUTO", n.Class) + } if !n.Type().IsInterface() { base.FatalfAt(n.Pos(), "name passed to assignments is not of an interface type: %v", n.Type()) @@ -432,6 +435,9 @@ func (s *State) analyze(nodes ir.Nodes) { if n.Op() != ir.ONAME { base.FatalfAt(n.Pos(), "n.Op = %v; want = ONAME", n.Op()) } + if n.Class != ir.PAUTO { + return nil, -1 + } switch a := assignment.(type) { case nil: