Skip to content

Commit

Permalink
couple tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
VSadov committed Nov 6, 2021
1 parent b9c3c6e commit 2769526
Showing 1 changed file with 5 additions and 6 deletions.
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

0 comments on commit 2769526

Please sign in to comment.