diff options
author | Tanner Gooding <tagoo@outlook.com> | 2019-02-14 22:24:40 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-14 22:24:40 -0800 |
commit | 9d3aea75de62972ddbc117f2d8703314e1e46183 (patch) | |
tree | 598c4f1c1d370bc9c9f30cc39cab0d626c286b07 | |
parent | 00f0c3250e4f2cd156753ccd17f005db696ff046 (diff) | |
download | coreclr-9d3aea75de62972ddbc117f2d8703314e1e46183.tar.gz coreclr-9d3aea75de62972ddbc117f2d8703314e1e46183.tar.bz2 coreclr-9d3aea75de62972ddbc117f2d8703314e1e46183.zip |
Fixing the number formatting code to only recognize 'R' for double/float. (#22613)
-rw-r--r-- | src/System.Private.CoreLib/shared/System/Number.Formatting.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Number.Formatting.cs b/src/System.Private.CoreLib/shared/System/Number.Formatting.cs index cd6133629e..aa6d69f21c 100644 --- a/src/System.Private.CoreLib/shared/System/Number.Formatting.cs +++ b/src/System.Private.CoreLib/shared/System/Number.Formatting.cs @@ -1723,6 +1723,11 @@ namespace System case 'R': case 'r': { + if (number.Kind != NumberBufferKind.FloatingPoint) + { + goto default; + } + format = (char)(format - ('R' - 'G')); Debug.Assert((format == 'G') || (format == 'g')); goto case 'G'; |