Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Fixing the float/double parsing logic to handle exponents that are too large/small #23043

Merged
merged 3 commits into from
Mar 6, 2019
Merged

Fixing the float/double parsing logic to handle exponents that are too large/small #23043

merged 3 commits into from
Mar 6, 2019

Conversation

tannergooding
Copy link
Member

@tannergooding
Copy link
Member Author

CC. @stephentoub, @danmosemsft

The Roslyn RealParser and ES6100M test validation suite both pass under Release. I am also running these under Debug bits but that will take overnight to run.

Will be adding a regression test to CoreFX for this scenario.

private const int DoubleMinExponent = -324;

private const int FloatingPointMaxExponent = DoubleMaxExponent;
private const int FloatingPointMinExponent = DoubleMinExponent;
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need these rather than just using DoubleMax/MinExponent?

Copy link
Member Author

Choose a reason for hiding this comment

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

It makes it easier to expand to support things like Binary128, if that ever happens.

Copy link
Member

Choose a reason for hiding this comment

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

Ok.

@tannergooding
Copy link
Member Author

I am also running these under Debug bits but that will take overnight to run.

These finished without failure as well (and would previously assert all over the place for the given failure case and similar strings).

@tannergooding tannergooding merged commit 5a26509 into dotnet:master Mar 6, 2019
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…o large/small (dotnet/coreclr#23043)

* Fixing the float/double parsing logic to handle exponents that are too large/small

* Fixing the debug assert to use >= and <=

* Fixing the max exponents to be +1 to match what scale uses.


Commit migrated from dotnet/coreclr@5a26509
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Double.Parse throws AccessViolationException on .NET Core 3.0
2 participants