Skip to content

Commit

Permalink
Revert change to ClassLoader::CreateTypeHandleForTypeDefThrowing
Browse files Browse the repository at this point in the history
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
  • Loading branch information
trylek committed May 24, 2021
1 parent c9297dd commit d4da238
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/coreclr/vm/methodtablebuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12019,24 +12019,24 @@ ClassLoader::CreateTypeHandleForTypeDefThrowing(
pAllocator,
pamTracker);

#ifdef _DEBUG
// Only MultiCastDelegate should inherit from Delegate
LPCUTF8 className;
LPCUTF8 nameSpace;
if (FAILED(pInternalImport->GetNameOfTypeDef(cl, &className, &nameSpace)))
{
className = nameSpace = "Invalid TypeDef record";
}
#endif

if ((pParentMethodTable != NULL) && (pParentMethodTable == g_pDelegateClass))
{
// Note we do not allow single cast delegates
if (pModule->GetAssembly() != SystemDomain::SystemAssembly())
{
pAssembly->ThrowTypeLoadException(pInternalImport, cl, BFA_CANNOT_INHERIT_FROM_DELEGATE);
}

#ifdef _DEBUG
// Only MultiCastDelegate should inherit from Delegate
LPCUTF8 className;
LPCUTF8 nameSpace;
if (FAILED(pInternalImport->GetNameOfTypeDef(cl, &className, &nameSpace)))
{
className = nameSpace = "Invalid TypeDef record";
}
BAD_FORMAT_NOTHROW_ASSERT(strcmp(className, "MulticastDelegate") == 0);
#endif
}

if (fIsDelegate)
Expand Down

0 comments on commit d4da238

Please sign in to comment.