From: Michal Strehovský Date: Tue, 26 Jun 2018 14:17:53 +0000 (+0200) Subject: Fix bogus assert in ArraySortHelper (dotnet/corert#6018) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bcabe118b783feb489c791e340f1c3ea792acde2;p=platform%2Fupstream%2Fcoreclr.git Fix bogus assert in ArraySortHelper (dotnet/corert#6018) Fixes #6016. Resolves #6015. Signed-off-by: dotnet-bot --- diff --git a/src/System.Private.CoreLib/shared/System/Collections/Generic/ArraySortHelper.cs b/src/System.Private.CoreLib/shared/System/Collections/Generic/ArraySortHelper.cs index b717bd7621..03b9865044 100644 --- a/src/System.Private.CoreLib/shared/System/Collections/Generic/ArraySortHelper.cs +++ b/src/System.Private.CoreLib/shared/System/Collections/Generic/ArraySortHelper.cs @@ -654,10 +654,10 @@ namespace System.Collections.Generic 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) {