mirror of
https://github.com/golang/go
synced 2024-11-15 04:30:32 -07:00
be152920b9
CL 327651 rewrites a, b = f() to use temporaries when types are not identical. That would leave OAS2 node appears in body of init function for global variables initialization. The staticinit pass is not updated to handle OAS2 node, causing ICE when compiling global variables. To fix this, handle OAS2 nodes like other OAS2*, since they mostly necessitate dynamic execution anyway. Fixes #68264 Change-Id: I1eff8cc3e47035738a2c70d3169e35ec36ee9242 Reviewed-on: https://go-review.googlesource.com/c/go/+/596055 Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
16 lines
268 B
Go
16 lines
268 B
Go
// compile
|
|
|
|
// Copyright 2024 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.
|
|
|
|
package p
|
|
|
|
type nat []int
|
|
|
|
var a, b nat = y()
|
|
|
|
func y() (nat, []int) {
|
|
return nat{0}, nat{1}
|
|
}
|