From 240a30da1b3f5d4d60640a09f135275e8fee8b92 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 15 Oct 2018 09:44:22 -0700 Subject: [PATCH] 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 --- src/cmd/compile/internal/gc/sinit.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/gc/sinit.go b/src/cmd/compile/internal/gc/sinit.go index d520f21e63a..f24da706252 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)