Skip to content

Commit 1a5ca06

Browse files
authored
Fix computation of hash code for class objects (#2840)
***NO_CI***
1 parent b24f5d6 commit 1a5ca06

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/CLR/Core/CLR_RT_HeapBlock.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,8 +1150,9 @@ CLR_UINT32 CLR_RT_HeapBlock::GetHashCode(CLR_RT_HeapBlock *ptr, bool fRecurse, C
11501150
{
11511151
do
11521152
{
1153-
crc = GetHashCode(&ptr[totFields + CLR_RT_HeapBlock::HB_Object_Fields_Offset], false, crc);
1154-
} while (--totFields > 0);
1153+
crc ^=
1154+
GetHashCode(&ptr[--totFields + CLR_RT_HeapBlock::HB_Object_Fields_Offset], true, crc);
1155+
} while (totFields > 0);
11551156
}
11561157
}
11571158
}

0 commit comments

Comments
 (0)