mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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 <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
parent
7c96d87eda
commit
240a30da1b
1 changed files with 3 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue