{
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)
{
<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' ">