Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #390: object.GetHashCode not working #852

Merged
merged 2 commits into from
Sep 12, 2018
Merged
Changes from all commits
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
11 changes: 9 additions & 2 deletions src/CLR/Core/CLR_RT_HeapBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -967,9 +967,16 @@ CLR_UINT32 CLR_RT_HeapBlock::GetHashCode( CLR_RT_HeapBlock* ptr, bool fRecurse,
CLR_RT_TypeDef_Instance cls; cls.InitializeFromIndex( ptr->ObjectCls() );
int totFields = cls.CrossReference().m_totalFields;

while(totFields-- > 0)
if (totFields > 0)
{
crc = GetHashCode( ++ptr, false, crc );
while(totFields-- > 0)
{
crc = GetHashCode( ++ptr, false, crc );
}
}
else
{
crc = SUPPORT_ComputeCRC( &ptr, sizeof(ptr), crc );
}
}
break;
Expand Down