Commit b9dbb030 authored by Håvard Haugen's avatar Håvard Haugen Committed by Dave Cheney

cmd/compiler/internal/gc: make Type.Copyto a []*Node

Passes go build -a -toolexec 'toolstash -cmp' std cmd

Change-Id: Ief4613cfb341172a85e3a894f44fb2bb308c7b55
Reviewed-on: https://go-review.googlesource.com/14554
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarDave Cheney <dave@cheney.net>
parent b07a51b3
......@@ -210,7 +210,7 @@ type Type struct {
Embedlineno int32 // first use of TFORW as embedded type
// for TFORW, where to copy the eventual value to
Copyto *NodeList
Copyto []*Node
Lastfn *Node // for usefield
}
......
......@@ -3544,7 +3544,7 @@ var mapqueue *NodeList
func copytype(n *Node, t *Type) {
if t.Etype == TFORW {
// This type isn't computed yet; when it is, update n.
t.Copyto = list(t.Copyto, n)
t.Copyto = append(t.Copyto, n)
return
}
......@@ -3569,8 +3569,8 @@ func copytype(n *Node, t *Type) {
t.Copyto = nil
// Update nodes waiting on this type.
for ; l != nil; l = l.Next {
copytype(l.N, t)
for _, n := range l {
copytype(n, t)
}
// Double-check use of type as embedded type.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment