Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions src/coreclr/vm/typehandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -971,17 +971,7 @@ TypeHandle TypeHandle::MergeArrayTypeHandlesToCommonParent(TypeHandle ta, TypeHa
return TypeHandle(g_pArrayClass);
}


{
// This should just result in resolving an already loaded type.
ENABLE_FORBID_GC_LOADER_USE_IN_THIS_SCOPE();
// == FailIfNotLoadedOrNotRestored
TypeHandle result = ClassLoader::LoadArrayTypeThrowing(tMergeElem, mergeKind, rank, ClassLoader::DontLoadTypes);
_ASSERTE(!result.IsNull());

// <TODO> should be able to assert IsRestored here </TODO>
return result;
}
return ClassLoader::LoadArrayTypeThrowing(tMergeElem, mergeKind, rank);
}

#endif // #ifndef DACCESS_COMPILE
Expand Down
30 changes: 30 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_120903/Runtime_120903.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.


namespace Runtime_120903;

using System;
using System.Runtime.CompilerServices;
using Xunit;

class B {}
class D1: B {}
class D2: B {}

public class Runtime_120903
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static int Merge(object[] b)
{
D1[] d1 = Unsafe.As<D1[]>(b);
return d1.Length;
}

[Fact]
public static void Problem()
{
D2[] d2 = new D2[10];
Console.WriteLine(Merge(d2));
}
}
1 change: 1 addition & 0 deletions src/tests/JIT/Regression/Regression_ro_1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<Compile Include="JitBlue\Runtime_120270\Runtime_120270.cs" />
<Compile Include="JitBlue\Runtime_120414\Runtime_120414.cs" />
<Compile Include="JitBlue\Runtime_120522\Runtime_120522.cs" />
<Compile Include="JitBlue\Runtime_120903\Runtime_120903.cs" />
<Compile Include="JitBlue\Runtime_121711\Runtime_121711.cs" />
<Compile Include="JitBlue\Runtime_31615\Runtime_31615.cs" />
<Compile Include="JitBlue\Runtime_33884\Runtime_33884.cs" />
Expand Down
Loading