Skip to content
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

Fix 32-bit floating point JSON parsing of maximal values for C# #10514

Merged
merged 1 commit into from
Sep 15, 2022

Conversation

jskeet
Copy link
Contributor

@jskeet jskeet commented Sep 7, 2022

Fixes #10509.

Copy link

@amanda-tarafa amanda-tarafa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +589 to +592
[TestCase("3.4028236e38", typeof(InvalidProtocolBufferException))]
[TestCase("-3.4028236e38", typeof(InvalidProtocolBufferException))]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super tiny nit (and just so that is clear at first sight that the string format is not the problem, use the same format in the valid and invalid tests):

Suggested change
[TestCase("3.4028236e38", typeof(InvalidProtocolBufferException))]
[TestCase("-3.4028236e38", typeof(InvalidProtocolBufferException))]
[TestCase("3.4028236e+38", typeof(InvalidProtocolBufferException))]
[TestCase("-3.4028236e+38", typeof(InvalidProtocolBufferException))]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... both formats should work. I'll update the tests to have both "with +" and without.

@mcy mcy merged commit 0d3eaed into protocolbuffers:main Sep 15, 2022
@jskeet jskeet deleted the float-parsing branch October 26, 2022 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON parsing of large 32-bit floating point values fails.
4 participants