mirror of
https://github.com/janet-lang/janet
synced 2025-01-13 17:10:27 +00:00
Correct behavior on 32 bit architecture when hashing pointers.
This commit is contained in:
parent
eef8a42ae7
commit
325059203d
@ -77,7 +77,13 @@ uint32_t gst_hash(GstValue x) {
|
|||||||
hash = gst_struct_hash(x.data.st);
|
hash = gst_struct_hash(x.data.st);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
hash = x.data.dwords[0] ^ x.data.dwords[1];
|
if (sizeof(double) == sizeof(void *)) {
|
||||||
|
/* Assuming 8 byte pointer */
|
||||||
|
hash = x.data.dwords[0] ^ x.data.dwords[1];
|
||||||
|
} else {
|
||||||
|
/* Assuming 4 byte pointer (or smaller) */
|
||||||
|
hash = (uint32_t) x.data.pointer;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return hash;
|
return hash;
|
||||||
|
Loading…
Reference in New Issue
Block a user