Fixing the number formatting code to only recognize 'R' for double/float. (dotnet...
authorTanner Gooding <tagoo@outlook.com>
Fri, 15 Feb 2019 06:24:40 +0000 (22:24 -0800)
committerGitHub <noreply@github.com>
Fri, 15 Feb 2019 06:24:40 +0000 (22:24 -0800)
Commit migrated from https://github.com/dotnet/coreclr/commit/9d3aea75de62972ddbc117f2d8703314e1e46183

src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs

index cd61336..aa6d69f 100644 (file)
@@ -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';