2
0
Эх сурвалжийг харах

Ifdef out code that triggers UTC bug (dotnet/corert#7003)

This results in bad codegen on AMD64. I filed a bug internally; hopefully we can get a fix soon.

Signed-off-by: dotnet-bot <[email protected]>
Michal Strehovský 7 жил өмнө
parent
commit
52d6e18ea6

+ 6 - 0
netcore/System.Private.CoreLib/shared/System/Array.cs

@@ -1022,6 +1022,8 @@ namespace System
                 ThrowHelper.ThrowCountArgumentOutOfRange_ArgumentOutOfRange_Count();
             }
 
+            // Hits a code generation bug on ProjectN
+#if !PROJECTN
             if (typeof(T) == typeof(byte))
             {
                 int result = SpanHelpers.IndexOf(
@@ -1041,6 +1043,7 @@ namespace System
 
                 return (result >= 0 ? startIndex : 0) + result;
             }
+#endif
 
 #if CORECLR
             return EqualityComparer<T>.Default.IndexOf(array, value, startIndex, count);
@@ -1207,6 +1210,8 @@ namespace System
                 ThrowHelper.ThrowCountArgumentOutOfRange_ArgumentOutOfRange_Count();
             }
 
+            // Hits a code generation bug on ProjectN
+#if !PROJECTN
             if (typeof(T) == typeof(byte))
             {
                 int endIndex = startIndex - count + 1;
@@ -1228,6 +1233,7 @@ namespace System
 
                 return (result >= 0 ? endIndex : 0) + result;
             }
+#endif
 
 #if CORECLR
             return EqualityComparer<T>.Default.LastIndexOf(array, value, startIndex, count);