Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
go/types: don't panic when multiplying infinities with zero #20583
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...