summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen Toub <stoub@microsoft.com>2018-06-27 03:30:38 (GMT)
committerGitHub <noreply@github.com>2018-06-27 03:30:38 (GMT)
commit9c6b90e42840050fec597cef53ae7d88695bf678 (patch)
treea9063e7dc87576fa56085a6fdef8cbcf477159bf /src
parent1cebf4d46325b40591adb8a0f914f0029e48fb57 (diff)
downloadcoreclr-9c6b90e42840050fec597cef53ae7d88695bf678.zip
coreclr-9c6b90e42840050fec597cef53ae7d88695bf678.tar.gz
coreclr-9c6b90e42840050fec597cef53ae7d88695bf678.tar.bz2
Fix number formatting exception with empty NumberGroupSizes array (#18221) (#18667)
Diffstat (limited to 'src')
-rw-r--r--src/mscorlib/shared/System/Number.Formatting.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mscorlib/shared/System/Number.Formatting.cs b/src/mscorlib/shared/System/Number.Formatting.cs
index 74395ab..387fe01 100644
--- a/src/mscorlib/shared/System/Number.Formatting.cs
+++ b/src/mscorlib/shared/System/Number.Formatting.cs
@@ -1974,13 +1974,14 @@ namespace System
if (groupDigits != null)
{
int groupSizeIndex = 0; // Index into the groupDigits array.
- int groupSizeCount = groupDigits[groupSizeIndex]; // The current total of group size.
int bufferSize = digPos; // The length of the result buffer string.
int groupSize = 0; // The current group size.
// Find out the size of the string buffer for the result.
if (groupDigits.Length != 0) // You can pass in 0 length arrays
{
+ int groupSizeCount = groupDigits[groupSizeIndex]; // The current total of group size.
+
while (digPos > groupSizeCount)
{
groupSize = groupDigits[groupSizeIndex];