diff --git a/eng/testing/ChromeVersions.props b/eng/testing/ChromeVersions.props index ff43dcee06fb2a..a921ce16c1b79d 100644 --- a/eng/testing/ChromeVersions.props +++ b/eng/testing/ChromeVersions.props @@ -1,11 +1,11 @@ - 115.0.5790.170 - 1148114 - https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/1148123 + 116.0.5845.96 + 1160321 + https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/1160321 - 115.0.5790.171 - 1148114 - https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/1148119 + 116.0.5845.97 + 1160321 + https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/1160375 diff --git a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs index 39770356157442..736873fd020bff 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs @@ -1389,12 +1389,12 @@ public bool MoveNext() ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion(); } + Entry[]? entries = _dictionary._entries; // Use unsigned comparison since we set index to dictionary.count+1 when the enumeration ends. // dictionary.count+1 could be negative if dictionary.count is int.MaxValue while ((uint)_index < (uint)_dictionary._count) { - ref Entry entry = ref _dictionary._entries![_index++]; - + ref Entry entry = ref entries![_index++]; if (entry.next >= -1) { _current = new KeyValuePair(entry.key, entry.value); @@ -1631,10 +1631,12 @@ public bool MoveNext() ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion(); } + Entry[]? entries = _dictionary._entries; + // Use unsigned comparison since we set index to dictionary.count+1 when the enumeration ends. + // dictionary.count+1 could be negative if dictionary.count is int.MaxValue while ((uint)_index < (uint)_dictionary._count) { - ref Entry entry = ref _dictionary._entries![_index++]; - + ref Entry entry = ref entries![_index++]; if (entry.next >= -1) { _currentKey = entry.key; @@ -1825,16 +1827,19 @@ public bool MoveNext() ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion(); } + Entry[]? entries = _dictionary._entries; + // Use unsigned comparison since we set index to dictionary.count+1 when the enumeration ends. + // dictionary.count+1 could be negative if dictionary.count is int.MaxValue while ((uint)_index < (uint)_dictionary._count) { - ref Entry entry = ref _dictionary._entries![_index++]; - + ref Entry entry = ref entries![_index++]; if (entry.next >= -1) { _currentValue = entry.value; return true; } } + _index = _dictionary._count + 1; _currentValue = default; return false;