mirror of
https://github.com/golang/go
synced 2024-11-23 19:40:08 -07:00
a146dd3a2f
CL 35261 makes SSA handle zero-valued STRUCTLIT, but DOT operation was not handled. Fixes #18994. Change-Id: Ic7976036acca1523b0b14afac4d170797e8aee20 Reviewed-on: https://go-review.googlesource.com/36565 Run-TryBot: Cherry Zhang <cherryyz@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
23 lines
399 B
Go
23 lines
399 B
Go
// run
|
|
|
|
// Copyright 2017 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// Issue 18994: SSA didn't handle DOT STRUCTLIT for zero-valued
|
|
// STRUCTLIT.
|
|
|
|
package main
|
|
|
|
// large struct - not SSA-able
|
|
type T struct {
|
|
a, b, c, d, e, f, g, h int
|
|
}
|
|
|
|
func main() {
|
|
x := T{}.a
|
|
if x != 0 {
|
|
panic("FAIL")
|
|
}
|
|
}
|