cmd/compile: do not emit code for discardable blank fields

Fixes #38690

Change-Id: I3544daf617fddc0f89636265c113001178d16b0c
Reviewed-on: https://go-review.googlesource.com/c/go/+/230121
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Cuong Manh Le 2020-04-28 00:41:02 +07:00
parent fdb8a3e638
commit 0f47c12a29
2 changed files with 68 additions and 0 deletions

View file

@ -528,6 +528,9 @@ func fixedlit(ctxt initContext, kind initKind, n *Node, var_ *Node, init *Nodes)
for _, r := range n.List.Slice() {
a, value := splitnode(r)
if a == nblank && candiscard(value) {
continue
}
switch value.Op {
case OSLICELIT: