Skip to content

Commit

Permalink
Complete
Browse files Browse the repository at this point in the history
  • Loading branch information
huoyaoyuan committed Jan 29, 2024
1 parent 8dd42ff commit e519b2b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/coreclr/vm/comutilnative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1705,12 +1705,13 @@ enum ValueTypeHashCodeStrategy
FastGetHashCode,
};

static ValueTypeHashCodeStrategy GetHashCodeStrategy(MethodTable* mt, void* pObjRef, UINT32* fieldOffset, UINT32* fieldSize)
static ValueTypeHashCodeStrategy GetHashCodeStrategy(MethodTable* mt, QCall::ObjectHandleOnStack objHandle, UINT32* fieldOffset, UINT32* fieldSize)
{
CONTRACTL{
CONTRACTL
{
THROWS;
GC_TRIGGERS;
MODE_COOPERATIVE;
MODE_PREEMPTIVE;
} CONTRACTL_END;

// Should be handled by caller
Expand All @@ -1729,7 +1730,7 @@ static ValueTypeHashCodeStrategy GetHashCodeStrategy(MethodTable* mt, void* pObj
{
GCX_COOP();
// if we get an object reference we get the hash code out of that
if (*(Object**)((BYTE *)objHandle->Unbox() + *fieldOffset + field->GetOffsetUnsafe()) != NULL)
if (*(Object**)((BYTE *)objHandle.Get()->UnBox() + *fieldOffset + field->GetOffsetUnsafe()) != NULL)
{
ret = ValueTypeHashCodeStrategy::ReferenceField;
}
Expand Down Expand Up @@ -1780,8 +1781,6 @@ static ValueTypeHashCodeStrategy GetHashCodeStrategy(MethodTable* mt, void* pObj
break;
}

GCPROTECT_END();

return ret;
}

Expand Down

0 comments on commit e519b2b

Please sign in to comment.