From: Keith Randall Date: Mon, 15 Oct 2018 16:44:22 +0000 (-0700) Subject: cmd/compile: check order temp has correct type X-Git-Tag: go1.12beta1~769 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=240a30da1b3f5d4d60640a09f135275e8fee8b92;p=gostls13.git cmd/compile: check order temp has correct type Followon from CL 140306 Change-Id: Ic71033d2301105b15b60645d895a076107f44a2e Reviewed-on: https://go-review.googlesource.com/c/142178 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- diff --git a/src/cmd/compile/internal/gc/sinit.go b/src/cmd/compile/internal/gc/sinit.go index d520f21e63..f24da70625 100644 --- a/src/cmd/compile/internal/gc/sinit.go +++ b/src/cmd/compile/internal/gc/sinit.go @@ -833,7 +833,9 @@ func slicelit(ctxt initContext, n *Node, var_ *Node, init *Nodes) { var a *Node if x := prealloc[n]; x != nil { // temp allocated during order.go for dddarg - x.Type = t + if !eqtype(t, x.Type) { + panic("dotdotdot base type does not match order's assigned type") + } if vstat == nil { a = nod(OAS, x, nil)