diff options
| author | Keith Randall <khr@google.com> | 2018-10-15 09:44:22 -0700 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2018-10-15 17:56:35 +0000 |
| commit | 240a30da1b3f5d4d60640a09f135275e8fee8b92 (patch) | |
| tree | 7cc383bcf97d13bb0be10da6cd4bc968705b79d9 /src | |
| parent | 7c96d87eda45c93bf7218b79bc8ba85a3a21b066 (diff) | |
| download | go-240a30da1b3f5d4d60640a09f135275e8fee8b92.tar.xz | |
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>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/compile/internal/gc/sinit.go | 4 |
1 files changed, 3 insertions, 1 deletions
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) |
