From 57bfe474518ab5b7cfe6bf7424a79ce3af9d6657 Mon Sep 17 00:00:00 2001 From: David Wrighton Date: Fri, 25 Jun 2021 11:10:50 -0700 Subject: [PATCH] Tweak classcompat loader to skip MethodImpls associated with static methods (#54658) --- src/coreclr/vm/classcompat.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/vm/classcompat.cpp b/src/coreclr/vm/classcompat.cpp index 3c9556a66232a..1870e6f3dd0a2 100644 --- a/src/coreclr/vm/classcompat.cpp +++ b/src/coreclr/vm/classcompat.cpp @@ -939,7 +939,7 @@ VOID MethodTableBuilder::BuildInteropVTable_PlaceMembers( } } - if(Classification & mdcMethodImpl) + if (Classification & mdcMethodImpl) { // If this method serves as the BODY of a MethodImpl specification, then // we should iterate all the MethodImpl's for this class and see just how many // of them this method participates in as the BODY. @@ -2807,7 +2807,7 @@ VOID MethodTableBuilder::EnumerateClassMethods() // on this type so we can just compare the tok with the body token found // from the overrides. for(DWORD impls = 0; impls < bmtMethodImpl->dwNumberMethodImpls; impls++) { - if(bmtMethodImpl->rgMethodImplTokens[impls].methodBody == tok) { + if ((bmtMethodImpl->rgMethodImplTokens[impls].methodBody == tok) && !IsMdStatic(dwMemberAttrs)) { Classification |= mdcMethodImpl; break; }