From 5678fe6fd6c74abf452ba1e3cd6b58d3b3fbbf0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 26 Jun 2018 16:17:53 +0200 Subject: [PATCH] Fix bogus assert in ArraySortHelper (dotnet/corert#6018) Fixes #6016. Resolves #6015. Signed-off-by: dotnet-bot --- .../CoreLib/System/Collections/Generic/ArraySortHelper.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Common/src/CoreLib/System/Collections/Generic/ArraySortHelper.cs b/src/Common/src/CoreLib/System/Collections/Generic/ArraySortHelper.cs index b717bd76219f..03b9865044f6 100644 --- a/src/Common/src/CoreLib/System/Collections/Generic/ArraySortHelper.cs +++ b/src/Common/src/CoreLib/System/Collections/Generic/ArraySortHelper.cs @@ -654,10 +654,10 @@ public void Sort(TKey[] keys, TValue[] values, int index, int length, IComparer< private static void SwapIfGreaterWithItems(TKey[] keys, TValue[] values, IComparer comparer, int a, int b) { Debug.Assert(keys != null); - Debug.Assert(values != null && values.Length >= keys.Length); + Debug.Assert(values != null); Debug.Assert(comparer != null); - Debug.Assert(0 <= a && a < keys.Length); - Debug.Assert(0 <= b && b < keys.Length); + Debug.Assert(0 <= a && a < keys.Length && a < values.Length); + Debug.Assert(0 <= b && b < keys.Length && b < values.Length); if (a != b) {