]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.22] cmd/compile: fix early deadcode with label statement
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Wed, 21 Feb 2024 11:50:11 +0000 (18:50 +0700)
committerThan McIntosh <thanm@google.com>
Tue, 26 Mar 2024 19:31:39 +0000 (19:31 +0000)
commit3826650c99b177364670dad9766ea499cab48dfc
treeb54261543e0fc4ede04743af24faba54a375b324
parente71b0b1fee7df59a99ab6b5192854695d21ff688
[release-branch.go1.22] cmd/compile: fix early deadcode with label statement

CL 517775 moved early deadcode into unified writer. with new way to
handle dead code with label statement involved: any statements after
terminating statement will be considered dead until next label
statement.

However, this is not safe, because code after label statement may still
refer to dead statements between terminating and label statement.

It's only safe to remove statements after terminating *and* label one.

Fixes #66134

Change-Id: Idb630165240931fad50789304a9e4535f51f56e2
Reviewed-on: https://go-review.googlesource.com/c/go/+/565596
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/569717
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/cmd/compile/internal/noder/writer.go
test/fixedbugs/issue65593.go [new file with mode: 0644]