Skip to content

Commit d4da238

Browse files
committed
Revert change to ClassLoader::CreateTypeHandleForTypeDefThrowing
I originally thought the modification may assist debugging layout issues as I did during the investigation. It however turns out that basically the same class name check can be put in EEClassLayoutInfo::CollectLayoutFieldMetadataThrowing so I am removing this as superfluous temporary instrumentation. Thanks Tomas
1 parent c9297dd commit d4da238

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/coreclr/vm/methodtablebuilder.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12019,24 +12019,24 @@ ClassLoader::CreateTypeHandleForTypeDefThrowing(
1201912019
pAllocator,
1202012020
pamTracker);
1202112021

12022-
#ifdef _DEBUG
12023-
// Only MultiCastDelegate should inherit from Delegate
12024-
LPCUTF8 className;
12025-
LPCUTF8 nameSpace;
12026-
if (FAILED(pInternalImport->GetNameOfTypeDef(cl, &className, &nameSpace)))
12027-
{
12028-
className = nameSpace = "Invalid TypeDef record";
12029-
}
12030-
#endif
12031-
1203212022
if ((pParentMethodTable != NULL) && (pParentMethodTable == g_pDelegateClass))
1203312023
{
1203412024
// Note we do not allow single cast delegates
1203512025
if (pModule->GetAssembly() != SystemDomain::SystemAssembly())
1203612026
{
1203712027
pAssembly->ThrowTypeLoadException(pInternalImport, cl, BFA_CANNOT_INHERIT_FROM_DELEGATE);
1203812028
}
12029+
12030+
#ifdef _DEBUG
12031+
// Only MultiCastDelegate should inherit from Delegate
12032+
LPCUTF8 className;
12033+
LPCUTF8 nameSpace;
12034+
if (FAILED(pInternalImport->GetNameOfTypeDef(cl, &className, &nameSpace)))
12035+
{
12036+
className = nameSpace = "Invalid TypeDef record";
12037+
}
1203912038
BAD_FORMAT_NOTHROW_ASSERT(strcmp(className, "MulticastDelegate") == 0);
12039+
#endif
1204012040
}
1204112041

1204212042
if (fIsDelegate)

0 commit comments

Comments
 (0)