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

Comments

Projects
None yet
4 participants
@thigaz
Copy link

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

This comment has been minimized.

Copy link
Member

commented Dec 13, 2018

Thanks for the report.

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

@ALTree

This comment has been minimized.

Copy link
Member

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 this to the Go1.12 milestone Dec 13, 2018

@randall77

This comment has been minimized.

Copy link
Contributor

commented Dec 13, 2018

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

@gopherbot

This comment has been minimized.

Copy link

commented Dec 17, 2018

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

@gopherbot gopherbot closed this in d924c33 Dec 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.