Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix a couple of missed details
  • Loading branch information
davidwrighton committed Nov 16, 2023
commit ff60cb926481960839dfd36639cd2d70b4ac0cc8
4 changes: 3 additions & 1 deletion src/coreclr/vm/classhash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,17 +755,19 @@ PTR_EEClassHashEntry EEClassHashTable::FindByNameHandle(const NameHandle* pName)

mdToken typeToken = pName->GetTypeToken();
ModuleBase *pNameModule = pName->GetTypeModule();
PREFIX_ASSUME(pNameModule != NULL);

switch (TypeFromToken(typeToken))
{
case mdtTypeDef:
PREFIX_ASSUME(pNameModule != NULL);
hash = ComputeHashFunctionWithTypeDef(pTable, m_pCaseSensitiveTable, pNameModule->GetMDImport(), typeToken, &failed);
break;
case mdtTypeRef:
PREFIX_ASSUME(pNameModule != NULL);
hash = ComputeHashFunctionWithTypeRef(pTable, m_pCaseSensitiveTable, pNameModule->GetMDImport(), typeToken, &failed);
break;
case mdtExportedType:
PREFIX_ASSUME(pNameModule != NULL);
hash = ComputeHashFunctionWithExportedType(pTable, m_pCaseSensitiveTable, pNameModule->GetMDImport(), typeToken, &failed);
break;
default:
Expand Down
20 changes: 20 additions & 0 deletions src/coreclr/vm/clsload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,26 @@ TypeHandle ClassLoader::LoadTypeByNameThrowing(Assembly *pAssembly,
ClassLoadLevel level)
{
WRAPPER_NO_CONTRACT;

CQuickBytes qbszNamespace;

if (nameSpace == NULL)
{
LPCUTF8 szFullyQualifiedName = name;
nameSpace = "";

if ((name = ns::FindSep(szFullyQualifiedName)) != NULL)
{
SIZE_T d = name - szFullyQualifiedName;
nameSpace = qbszNamespace.SetString(szFullyQualifiedName, d);
name++;
}
else
{
name = szFullyQualifiedName;
}
}

NameHandle nameHandle(nameSpace, name);
return LoadTypeByNameThrowing(pAssembly, &nameHandle, fNotFound, fLoadTypes, level);
}
Expand Down