Skip to content

Commit 89603ec

Browse files
authored
Move setting fHasVirtualStaticMethods out of sanity check section (#54574)
1 parent 0416c34 commit 89603ec

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/coreclr/vm/methodtablebuilder.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2906,6 +2906,13 @@ MethodTableBuilder::EnumerateClassMethods()
29062906
IDS_CLASSLOAD_BADSPECIALMETHOD,
29072907
tok);
29082908
}
2909+
2910+
// Check for the presence of virtual static methods
2911+
if (IsMdVirtual(dwMemberAttrs) && IsMdStatic(dwMemberAttrs))
2912+
{
2913+
bmtProp->fHasVirtualStaticMethods = TRUE;
2914+
}
2915+
29092916
//
29102917
// But first - minimal flags validity checks
29112918
//
@@ -2972,11 +2979,7 @@ MethodTableBuilder::EnumerateClassMethods()
29722979
}
29732980
if(IsMdStatic(dwMemberAttrs))
29742981
{
2975-
if (fIsClassInterface)
2976-
{
2977-
bmtProp->fHasVirtualStaticMethods = TRUE;
2978-
}
2979-
else
2982+
if (!fIsClassInterface)
29802983
{
29812984
// Static virtual methods are only allowed to exist in interfaces
29822985
BuildMethodTableThrowException(BFA_VIRTUAL_STATIC_METHOD);

0 commit comments

Comments
 (0)