]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix ICE when compiling global a, b = f()
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 2 Jul 2024 10:17:39 +0000 (17:17 +0700)
committerGopher Robot <gobot@golang.org>
Fri, 5 Jul 2024 10:45:32 +0000 (10:45 +0000)
commitbe152920b90dd0fd73e2b2d6ffea294e09fc36be
treefe60e6b03b100336faf2018fecb295360433f069
parent82c14346d89ec0eeca114f9ca0e88516b2cda454
cmd/compile: fix ICE when compiling global a, b = f()

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>
src/cmd/compile/internal/staticinit/sched.go
test/fixedbugs/issue68264.go [new file with mode: 0644]