diff options
author | Ian Lance Taylor <iant@golang.org> | 2018-12-07 18:22:04 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2018-12-11 03:20:37 +0000 |
commit | 1ac3b0618170279474fcdf9c625b2e237bf2881c (patch) | |
tree | 98012135690adb5abd57cbdba2b3884b487c9c44 /src/cmd/compile | |
parent | 56b70d98f522be3c1fed7df3d0359c913a2a1bc7 (diff) | |
download | go-git-1ac3b0618170279474fcdf9c625b2e237bf2881c.tar.gz |
cmd/compile: emit a symbol for a method expression when using -dynlink
Fixes #25065
Change-Id: Ia3db518cfd9c006caf951b51342a491ac8372e9c
Reviewed-on: https://go-review.googlesource.com/c/153297
Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/cmd/compile')
-rw-r--r-- | src/cmd/compile/internal/gc/typecheck.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/gc/typecheck.go b/src/cmd/compile/internal/gc/typecheck.go index 633c5e5061..4fc1c5c73c 100644 --- a/src/cmd/compile/internal/gc/typecheck.go +++ b/src/cmd/compile/internal/gc/typecheck.go @@ -2514,6 +2514,12 @@ func typecheckMethodExpr(n *Node) (res *Node) { n.Xoffset = 0 n.SetClass(PFUNC) // methodSym already marked n.Sym as a function. + + // Issue 25065. Make sure that we emit the symbol for a local method. + if Ctxt.Flag_dynlink && !inimport && (t.Sym == nil || t.Sym.Pkg == localpkg) { + makefuncsym(n.Sym) + } + return n } |