-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
go/types, types2: internal compiler error: panic: Config.Sizes.Sizeof returned a size < 0 #59190
Comments
The minimum case: package main
import "unsafe"
type A [1 << 33]byte
type T [1 << 30]A
func main() {
var t T
println(unsafe.Sizeof(t))
} But the following code doesn't cause compiler crashes: package main
import "unsafe"
type A [1 << 33]byte
type T [1 << 31]A
func main() {
var t T
println(unsafe.Sizeof(t))
} BTW2, the following code also doesn't cause compiler crashes, but the error message looks not good:
|
Thanks for reporting. The case that doesn't produce a crash is a different issue. Filed #59207 for that. |
Change https://go.dev/cl/478919 mentions this issue: |
I filed #59209 for the case that produces a bad error message ( |
Change https://go.dev/cl/479116 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://go.dev/play/p/bF8KMRTERIW
What did you expect to see?
Errors are reported.
What did you see instead?
The text was updated successfully, but these errors were encountered: