]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: handle constant-folding of an out-of-range jump table index
authorKeith Randall <khr@golang.org>
Wed, 20 Dec 2023 23:38:50 +0000 (15:38 -0800)
committerKeith Randall <khr@golang.org>
Thu, 21 Dec 2023 00:15:58 +0000 (00:15 +0000)
commitf6509cf5cdbb5787061b784973782933c47f1782
treeccfccc1031dbd0e0be172e1ea7303e827531742d
parentadec22b9f7c9d9cfb95ff6af1c63ec489d6e9bb8
cmd/compile: handle constant-folding of an out-of-range jump table index

The input index to a jump table can be out of range for unreachable code.

Dynamically the compiler ensures that an out-of-range index can never
reach a jump table, but that guarantee doesn't extend to the static
realm.

Fixes #64826

Change-Id: I5829f3933ae5124ffad8337dfd7dd75e67a8ec33
Reviewed-on: https://go-review.googlesource.com/c/go/+/552055
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/sccp.go
test/fixedbugs/issue64826.go [new file with mode: 0644]