PR Feedback and exclude regression test on 64-bit processes.
authorJeremy Koritzinsky <jekoritz@microsoft.com>
Wed, 26 Sep 2018 17:31:58 +0000 (10:31 -0700)
committerJeremy Koritzinsky <jekoritz@microsoft.com>
Wed, 26 Sep 2018 17:31:58 +0000 (10:31 -0700)
src/System.Private.CoreLib/shared/System/Runtime/InteropServices/SafeBuffer.cs
tests/src/Regressions/coreclr/GitHub_7829/test7829.csproj

index 74edae3..0896d99 100644 (file)
@@ -112,7 +112,10 @@ namespace System.Runtime.InteropServices
         {
             try
             {
-                _numBytes = checked((UIntPtr)((ulong)numElements * sizeOfEachElement));
+                UIntPtr numBytes = checked((UIntPtr)((ulong)numElements * sizeOfEachElement));
+                if (numBytes == Uninitialized)
+                    throw new ArgumentOutOfRangeException(nameof(numElements), SR.ArgumentOutOfRange_UIntPtrMax);
+                _numBytes = numBytes;
             }
             catch (OverflowException)
             {
index cfe6d36..a5eaa49 100644 (file)
@@ -11,6 +11,7 @@
     <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <CLRTestKind>BuildAndRun</CLRTestKind>
+    <DisableProjectBuild Condition="'$(__BuildArch)' == 'x64' or '$(__BuildArch)' == 'arm64'">true</DisableProjectBuild>
   </PropertyGroup>
   <!-- Default configurations to help VS understand the configurations -->
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">