Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: internal compiler error: second walk of switch #29220

Closed
thigaz opened this issue Dec 13, 2018 · 4 comments
Closed

cmd/compile: internal compiler error: second walk of switch #29220

thigaz opened this issue Dec 13, 2018 · 4 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@thigaz
Copy link

thigaz commented Dec 13, 2018

The following program reports the error: "prog.go:18:51: internal compiler error: second walk of switch"

package main

func ascii(r rune) rune {
	switch {
	case 97 <= r && r <= 122:
		return r - 32
	case 65 <= r && r <= 90:
		return r + 32
	default:
		return r
	}
}

func main() {
	nomeObjeto := "ABE1FK21"
	println(string(nomeObjeto[1:4]))
	println(ascii(rune(nomeObjeto[4])) >= 48 && ascii(rune(nomeObjeto[4])) <= 57)
	println(string(nomeObjeto[5]))
	println(string(nomeObjeto[6:10]))
}
@ALTree
Copy link
Member

ALTree commented Dec 13, 2018

Thanks for the report.

playground link: https://play.golang.org/p/i_3ZK71BtF9

@ALTree
Copy link
Member

ALTree commented Dec 13, 2018

The issue is reproducible on linux/amd64, both with go1.11 and current tip (go version devel +9eb383e8f0).

@ALTree ALTree changed the title The Go Playground cmd/compile: internal compiler error: second walk of switch Dec 13, 2018
@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 13, 2018
@ALTree ALTree added this to the Go1.12 milestone Dec 13, 2018
@randall77
Copy link
Contributor

@dr2chase : that error message was added in https://go-review.googlesource.com/118318

@gopherbot
Copy link

Change https://golang.org/cl/154497 mentions this issue: cmd/compile: prevent double-walk of switch for OPRINT/OPRINTN

@golang golang locked and limited conversation to collaborators Dec 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants