Skip to content

Commit 66b6ed2

Browse files
committed
Fix Crossgen2 compilation failures in several type generator tests
As the PR #44041 effectively decoupled OwningType from Method in MethodWithToken, I believe we now need to include OwningType in the Equals check, otherwise we may (and sometimes do) crash in the assertion failure checking that OwningType matches between instances. Thanks Tomas
1 parent 355eff5 commit 66b6ed2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,9 @@ public override int GetHashCode()
221221

222222
public bool Equals(MethodWithToken methodWithToken)
223223
{
224-
bool equals = Method == methodWithToken.Method && Token.Equals(methodWithToken.Token) && ConstrainedType == methodWithToken.ConstrainedType &&
225-
Unboxing == methodWithToken.Unboxing;
224+
bool equals = Method == methodWithToken.Method && Token.Equals(methodWithToken.Token)
225+
&& OwningType == methodWithToken.OwningType && ConstrainedType == methodWithToken.ConstrainedType
226+
&& Unboxing == methodWithToken.Unboxing;
226227
if (equals)
227228
{
228229
Debug.Assert(OwningTypeNotDerivedFromToken == methodWithToken.OwningTypeNotDerivedFromToken);

0 commit comments

Comments
 (0)