-
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
cmd/compile: stack overflow on invalid map key type #21657
Comments
This stack overflows since Go1.5, and seems to infinite loop on Go1.0 to Go1.4. |
\cc @randall77 @josharian |
Generally, this would be handled by dowidth setting Broke on invalid recursive struct types. Also, algtype checks for Broke. The problem is we're calling algtype to validate map key types during typechecking before we've called dowidth on those key types, and before it's even safe to do so. We have some logic for deferring map key type validation until it's safe. I think the solution is to extend that to defer validation more often, maybe even all the time. |
Change https://golang.org/cl/75310 mentions this issue: |
What version of Go are you using (
go version
)?go version go1.9 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
Attempt to build the following program:
What did you expect to see?
go build
should report something like recursive type errors, then terminate with exit code 1 without panic.What did you see instead?
The text was updated successfully, but these errors were encountered: