-
Notifications
You must be signed in to change notification settings - Fork 18k
strconv: ParseFloat panics on very long, valid inputs #2642
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
Labels
Milestone
Comments
The comment in decimal.go states "TODO(rsc): Can make d[] a bit smaller and add truncated bool;". I'm actually curious why an array was used at all, instead of a slice initialized to a smaller value and autoexpanding as necessary. If that would be a valid solution, I could try writing a patch although I'll freely admit I remember practically nothing about the representation of floating point values, and it'll be a learning experience for me. As far as I can tell, should be pretty simple just converting to a slice representation and changing to appends where necessary. Sanjay |
Hum, i'm not sure what you are referring to. Is it CL http://golang.org/cl/5503085/ ? In this CL I suggest using a *small* buffer in some cases, while still allowing for the 800-byte buffer. It is a bit ugly, but thanks to escape analysis, both are on the stack, but only the one that comes into scope is zeroed (and zeroing 800 bytes is a significant portion of the call). However, escape analysis must be improved for this to work, which is proposed in CL http://golang.org/cl/5489128/ . It would be great if you could have a look at it, because I think it could have benefits in other places. |
Owner changed to builder@golang.org. |
Owner changed to @rsc. Status changed to Started. |
This issue was closed by revision 3ee2085. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: