Skip to content
Merged
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
couple tweaks
  • Loading branch information
VSadov committed Nov 6, 2021
commit 2769526763914d7031eb4bbdea8af544fc037c2a
11 changes: 5 additions & 6 deletions src/coreclr/vm/typehash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ static DWORD HashPossiblyInstantiatedType(mdTypeDef token, Instantiation inst)
dwHash = ((dwHash << 5) + dwHash) ^ token;
if (!inst.IsEmpty())
{
dwHash = ((dwHash << 5) + dwHash) ^ inst.GetNumArgs();

// Hash n type parameters
for (DWORD i = 0; i < inst.GetNumArgs(); i++)
{
Expand Down Expand Up @@ -224,10 +222,6 @@ static DWORD HashTypeHandle(TypeHandle t)
{
retVal = HashParamType(t.GetInternalCorElementType(), t.GetTypeParam());
}
else if (t.IsGenericVariable())
{
retVal = (dac_cast<PTR_TypeVarTypeDesc>(t.AsTypeDesc())->GetToken());
}
else if (t.HasInstantiation())
{
retVal = HashPossiblyInstantiatedType(t.GetCl(), t.GetInstantiation());
Expand All @@ -237,6 +231,11 @@ static DWORD HashTypeHandle(TypeHandle t)
FnPtrTypeDesc* pTD = t.AsFnPtrType();
retVal = HashFnPtrType(pTD->GetCallConv(), pTD->GetNumArgs(), pTD->GetRetAndArgTypesPointer());
}
else if (t.IsGenericVariable())
{
_ASSERTE(!"Generic variables are unexpected here.");
retVal = t.AsTAddr();
}
else
retVal = HashPossiblyInstantiatedType(t.GetCl(), Instantiation());

Expand Down