mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
fdb8a3e638
commit
0f47c12a29
2 changed files with 68 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue