Test was evidently assuming that because an object that referred to an array
was pinned, so was the array. Failure was intermittent, GC is not guaranteed
to move objects or to render their former contents inaccessible.
Fixes dotnet/coreclr#24173.
Fixes dotnet/coreclr#24464.
Commit migrated from https://github.com/dotnet/coreclr/commit/
9271757d2c917c5650c459a4c3fa648c2968a591
<OutputType>Exe</OutputType>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
-
- <!-- Test currently fails under GCStress. https://github.com/dotnet/coreclr/issues/24173 -->
- <GCStressIncompatible>true</GCStressIncompatible>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputType>Exe</OutputType>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
- <!-- https://github.com/dotnet/coreclr/issues/24464 -->
- <GCStressIncompatible>true</GCStressIncompatible>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
{
.entrypoint
.maxstack 8
- .locals (class Test.AA pinned, native unsigned int[0...], native unsigned int, int32)
+ .locals (class Test.AA pinned, native unsigned int[0...], native unsigned int, int32, native unsigned int[0...] pinned)
newobj instance void Test.AA::.ctor()
stloc.0
+ // test bug fix: make sure to pin Test.AA::m_ai
+ ldloc.0
+ ldfld native unsigned int[0...] Test.AA::m_ai
+ stloc 4
+
ldc.i4 18
stloc.2