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: Initializing an empty map causes divide by zero panic at init! #11354
Comments
Yes, this is definitely a bug in 1.4. Some types come out of the compiler with a nonzero size but a zero alignment. At least one of the culprits was the types used for map buckets, they were assigned a width but no alignment as map buckets don't need alignment info. But somehow those types are getting shared with other types that do need alignment info. This is why [8]X triggers the bug but not [7]X or [9]X. This is fixed in 1.5 because we use dowidth() on the map types to compute their size (Dmitry made this change for other reasons, if I remember correctly). I'm going to add a check to 1.5 to make sure it really is fixed and stays fixed. |
CL https://golang.org/cl/11406 mentions this issue. |
… alignment See issue #11354. Change-Id: I6817d499e6c02e4a9c83f80bc66a2bee368a69ec Reviewed-on: https://go-review.googlesource.com/11406 Reviewed-by: Russ Cox <rsc@golang.org>
Closing because fixed in 1.5. |
CL https://golang.org/cl/38468 mentions this issue. |
Seems to be fixed in 1.5, but for the record.
http://play.golang.org/p/5R2CZTLcB5 causes a divide by zero panic.
The text was updated successfully, but these errors were encountered: