]> Cypherpunks repositories - gostls13.git/commit
[dev.regabi] cmd/compile: fix ICE due to large uint64 constants
authorMatthew Dempsky <mdempsky@google.com>
Sun, 3 Jan 2021 22:24:25 +0000 (14:24 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 4 Jan 2021 10:30:07 +0000 (10:30 +0000)
commit290b4154b73b54045a147f463c6988b935d75d49
tree4a5b324068102b980343e487e4b0b6a0ca7c2d57
parenta30fd5288415cb1e4a91ec89fac725a9ee7a3d05
[dev.regabi] cmd/compile: fix ICE due to large uint64 constants

It's an error to call Int64Val on constants that don't fit into
int64. CL 272654 made the compiler stricter about detecting misuse,
and revealed that we were using it improperly in detecting consecutive
integer-switch cases. That particular usage actually did work in
practice, but it's easy and best to just fix it.

Fixes #43480.

Change-Id: I56f722d75e83091638ac43b80e45df0b0ad7d48d
Reviewed-on: https://go-review.googlesource.com/c/go/+/281272
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/walk/switch.go
test/fixedbugs/issue43480.go [new file with mode: 0644]