]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix typecheck range over rune literal
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 30 Nov 2023 17:16:24 +0000 (00:16 +0700)
committerGopher Robot <gobot@golang.org>
Fri, 1 Dec 2023 17:20:08 +0000 (17:20 +0000)
commitfbfe62bc802d27539a858afd66ae335ff94b1d25
tree50fba20f0a404a763f676459c4e14ba6a1b9452e
parent446a5dcf5a3230ce9832682d8f521071d8a34a2b
cmd/compile: fix typecheck range over rune literal

With range over int, the rune literal in range expression will be left
as untyped rune, but idealType is not handling this case, causing ICE.

Fixing this by setting the concrete type for untyped rune expresison.

Fixes #64471

Change-Id: I07a151c54ea1d9e1b92e4d96cdfb6e73dca13862
Reviewed-on: https://go-review.googlesource.com/c/go/+/546296
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/compile/internal/noder/helpers.go
test/range3.go