]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: NewSelectorExpr use n.Pos instead of base.Pos
authorChaoqun Han <hanssccv@gmail.com>
Mon, 8 Nov 2021 14:58:51 +0000 (22:58 +0800)
committerDavid Chase <drchase@google.com>
Tue, 9 Nov 2021 19:08:35 +0000 (19:08 +0000)
Fixes #49436

Change-Id: I4c8851e7aaee631d5eb22f2ef0aea5a25e936d87
Reviewed-on: https://go-review.googlesource.com/c/go/+/361917
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Trust: David Chase <drchase@google.com>

src/cmd/compile/internal/typecheck/subr.go

index 1986845f64299df7151cd9179dbe89ceaf3fe11f..5b5b04371517516c8af7e3a5d79f39cfa4b9b38d 100644 (file)
@@ -160,7 +160,7 @@ func AddImplicitDots(n *ir.SelectorExpr) *ir.SelectorExpr {
        case path != nil:
                // rebuild elided dots
                for c := len(path) - 1; c >= 0; c-- {
-                       dot := ir.NewSelectorExpr(base.Pos, ir.ODOT, n.X, path[c].field.Sym)
+                       dot := ir.NewSelectorExpr(n.Pos(), ir.ODOT, n.X, path[c].field.Sym)
                        dot.SetImplicit(true)
                        dot.SetType(path[c].field.Type)
                        n.X = dot