Skip to content

Commit 57bfe47

Browse files
Tweak classcompat loader to skip MethodImpls associated with static methods (#54658)
1 parent 3924d03 commit 57bfe47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/coreclr/vm/classcompat.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ VOID MethodTableBuilder::BuildInteropVTable_PlaceMembers(
939939
}
940940
}
941941

942-
if(Classification & mdcMethodImpl)
942+
if (Classification & mdcMethodImpl)
943943
{ // If this method serves as the BODY of a MethodImpl specification, then
944944
// we should iterate all the MethodImpl's for this class and see just how many
945945
// of them this method participates in as the BODY.
@@ -2807,7 +2807,7 @@ VOID MethodTableBuilder::EnumerateClassMethods()
28072807
// on this type so we can just compare the tok with the body token found
28082808
// from the overrides.
28092809
for(DWORD impls = 0; impls < bmtMethodImpl->dwNumberMethodImpls; impls++) {
2810-
if(bmtMethodImpl->rgMethodImplTokens[impls].methodBody == tok) {
2810+
if ((bmtMethodImpl->rgMethodImplTokens[impls].methodBody == tok) && !IsMdStatic(dwMemberAttrs)) {
28112811
Classification |= mdcMethodImpl;
28122812
break;
28132813
}

0 commit comments

Comments
 (0)