From fce449680a241a283f7661edb94eef5427bf595c Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Sat, 8 Oct 2022 12:32:06 +0700 Subject: cmd/compile: fix missing walk pass for static initialization slice CL 403995 fixed static init of literal contains dynamic exprs, by ensuring their init are ordered properly. However, we still need to walk the generated init codes before appending to parent init. Otherwise, codes that requires desugaring will be unhandled, causing the compiler backend crashing. Fixes #56105 Change-Id: Ic25fd4017473f5412c8e960a91467797a234edfd Reviewed-on: https://go-review.googlesource.com/c/go/+/440455 Reviewed-by: Matthew Dempsky Auto-Submit: Cuong Manh Le TryBot-Result: Gopher Robot Reviewed-by: Keith Randall Run-TryBot: Cuong Manh Le Reviewed-by: Keith Randall --- src/cmd/compile/internal/walk/complit.go | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/cmd/compile/internal/walk/complit.go b/src/cmd/compile/internal/walk/complit.go index ce7b731ca6..0c5ba97e4a 100644 --- a/src/cmd/compile/internal/walk/complit.go +++ b/src/cmd/compile/internal/walk/complit.go @@ -243,6 +243,7 @@ func fixedlit(ctxt initContext, kind initKind, n *ir.CompLitExpr, var_ ir.Node, // 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 -- cgit v1.3-5-g45d5