We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For the following program:
package main var f = 7 / "0"[0]
go tool compile says:
go tool compile
tmp.go:2: constant 1197 overflows byte
Now sure where 1197 came from, but it must be 0 and the program must compile successfully.
go version devel +514014c Thu Jun 18 15:54:35 2015 +0200 linux/amd64
The text was updated successfully, but these errors were encountered:
I've looked into this a bit, and that particular value is coming from gc.Umagic:
ord("0") = 48 Umagic(48) = 171 with shift of 5 7 * 171 = 1197
In gc.walkdiv there is different logic used depending on if the divisor is a power of two or not, so it sometimes works:
https://play.golang.org/p/m4lGOWIADg
Same root cause as #11358
https://go-review.googlesource.com/11400
Sorry, something went wrong.
CL https://golang.org/cl/11400 mentions this issue.
765c0f3
No branches or pull requests
For the following program:
go tool compile
says:Now sure where 1197 came from, but it must be 0 and the program must compile successfully.
go version devel +514014c Thu Jun 18 15:54:35 2015 +0200 linux/amd64
The text was updated successfully, but these errors were encountered: