-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: don't panic when multiplying infinities with zero #20583
Comments
Change https://golang.org/cl/76190 mentions this issue: |
More crashers from a test I wrote for the CL above (later abandoned since I didn't like the fix):
Anything that can cause an |
Here's another example:
where the product x*x leads to an infinity internally. A correct solution really needs to recognize any kind of overflow to infinity. Concretely, in go/constant/value.go, we need to recognize these cases in the internal constructor functions (makeRat, makeFloat, etc.) and (probably) return an unknownVal if we have overflow. Generally unknown vals are "silent" but in these cases we need to also report an error. Ideally, the existing functions returned an error, but that ship has sailed. We could have "signaling unknown vals" and quiet ones (with a signaling one becoming quiet after first use). I'm going to assign this to me for now. Still thinking... |
Unclear this needs to be fixed for Go 1.10. Feel free to punt to Go 1.11 if you want. |
Not urgent. Moving to unplanned. |
Change https://golang.org/cl/271706 mentions this issue: |
Found by @josharian with go-fuzz and factored out from #20227 since it has a different root cause.
The following:
works in
compile
:but crashes
go/types
:The text was updated successfully, but these errors were encountered: