diff options
author | Elvis Pranskevichus <elvis@edgedb.com> | 2021-08-04 19:25:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-04 19:25:44 -0700 |
commit | fa355239e70411179c70b16ed4ff7113d8008dad (patch) | |
tree | 776efefb6e20a2ef53a903172032250f86acb5d6 /LICENSE-APACHE | |
parent | 3f8cb24cf3da3af1b86ef61cefc091784d39ec08 (diff) | |
download | immutables-fa355239e70411179c70b16ed4ff7113d8008dad.tar.gz immutables-fa355239e70411179c70b16ed4ff7113d8008dad.zip |
Fix test_none_collisions on 32-bit systems (#69)
There are two issues at play here:
1. Python version of `map_hash` unnecessarily performs hash truncation
even if the hash is already 32-bit wide, which potentially converts
it from signed int to unsigned long.
2. The `test_none_collisions` test generates a collision node with
hash greater than 2^32.
Both of these are problematic on 32-bit systems, where `sizeof(Py_hash_t)`
is 4, and so anything that doesn't fit into `Py_hash_t` gets bit-mangled,
breaking the `hash(x) != x` invariance that the test relies upon.
Fixes: #53
Fixes: #50
Diffstat (limited to 'LICENSE-APACHE')
0 files changed, 0 insertions, 0 deletions