mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-10-08 00:45:41 +00:00
ubsan cleanup
This commit is contained in:
+6
-7
@@ -6,18 +6,17 @@ pdb_hash_v1(String8 string)
|
||||
{
|
||||
U32 result = 0;
|
||||
U8 *ptr = string.str;
|
||||
U8 *opl = ptr + (string.size&(~3));
|
||||
for(; ptr < opl; ptr += 4)
|
||||
for(U8 *opl = ptr + (string.size & (~3)); ptr < opl; ptr += 4)
|
||||
{
|
||||
result ^= *(U32*)ptr;
|
||||
result ^= memory_read32(ptr);
|
||||
}
|
||||
if((string.size&2) != 0)
|
||||
if((string.size & 2) != 0)
|
||||
{
|
||||
result ^= *(U16*)ptr; ptr += 2;
|
||||
result ^= memory_read16(ptr); ptr += 2;
|
||||
}
|
||||
if((string.size&1) != 0)
|
||||
if((string.size & 1) != 0)
|
||||
{
|
||||
result ^= *ptr;
|
||||
result ^= memory_read8(ptr);
|
||||
}
|
||||
result |= 0x20202020;
|
||||
result ^= (result >> 11);
|
||||
|
||||
Reference in New Issue
Block a user