src/cmd/compile/internal/walk/complit.go | 1 + test/fixedbugs/issue56105.go | 11 +++++++++++ diff --git a/src/cmd/compile/internal/walk/complit.go b/src/cmd/compile/internal/walk/complit.go index 595fe8538caec6596c7b400d61ce58719c21d5b9..603c479a089913c60bf960cd57594f246a592e58 100644 --- a/src/cmd/compile/internal/walk/complit.go +++ b/src/cmd/compile/internal/walk/complit.go @@ -243,6 +243,7 @@ // expression, which will be initialized later, causing liveness analysis // confuses about variables lifetime. So making sure those expressions // are ordered correctly here. See issue #52673. orderBlock(&sinit, map[string][]*ir.Name{}) + walkStmtList(sinit) } init.Append(sinit...) continue diff --git a/test/fixedbugs/issue56105.go b/test/fixedbugs/issue56105.go new file mode 100644 index 0000000000000000000000000000000000000000..ecbe26580730690a2f58ac36be3d24817fbfdb20 --- /dev/null +++ b/test/fixedbugs/issue56105.go @@ -0,0 +1,11 @@ +// compile -d=libfuzzer + +// Copyright 2022 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 + +func f() { + _ = [...][]int{{}, {}, {}, {}, {}} +}