]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: preserve Type.nod in copytype
authorMatthew Dempsky <mdempsky@google.com>
Mon, 6 Mar 2017 20:57:44 +0000 (12:57 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 6 Mar 2017 22:16:05 +0000 (22:16 +0000)
commit5d0c20efc7bb373107535543f75741465fe93d3f
tree90ec2203df850814c3ae03133ec2aae2b6395884
parent4b261a141006667b687978a61aedb7222d6be0e4
cmd/compile: preserve Type.nod in copytype

By clearing out t.nod in copytype, we effectively lose the reference
from a Type back to its declaring OTYPE Node. This means later in
typenamesym when we add typenod(t) to signatlist, we end up creating a
new OTYPE Node. Moreover, this Node's position information will depend
on whatever context it happens be needed, and will be used for the
Type's position in the export data.

Updates #19391.

Change-Id: Ied93126449f75d7c5e3275cbdcc6fa657a8aa21d
Reviewed-on: https://go-review.googlesource.com/37870
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/bimport.go
src/cmd/compile/internal/gc/typecheck.go