Simon McVittie
de7abf54c7
ghash: Correctly retrieve low 32 bits of 64-bit values
...
Dereferencing a pointer to a 64-bit object as though it was a 32-bit
object is the same as taking the least significant 32 bits on a
little-endian machine, but on a big-endian machine it is the same as
taking the *most* significant 32 bits, which would result in these hash
functions always hashing to zero. The /hash/int64/collisions and
/hash/double/collisions test-cases in glib/tests/hash.c detect this
and fail.
Instead, fetch the whole 64-bit quantity and do the bit-manipulation
to xor the more significant half with the less significant half in an
architecture-neutral way.
Fixes: dd1f4f70
"Optimize g_double_hash implementation"
Fixes: c1af4b2b
"Optional optimization for `g_int64_hash`"
Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/2787
Signed-off-by: Simon McVittie <smcv@collabora.com >
2022-10-24 10:46:57 +01:00
..
2022-06-01 12:44:23 +01:00
2021-04-19 19:23:10 +01:00
2019-01-15 15:11:43 +00:00
2022-10-13 20:53:56 -04:00
2022-10-13 20:53:56 -04:00
2022-10-20 11:59:53 +00:00
2022-10-20 03:37:03 +02:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-06-07 13:47:42 +00:00
2022-05-27 15:27:19 +01:00
2022-10-13 23:56:18 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-06-23 13:19:05 +00:00
2022-09-15 01:18:42 +02:00
2022-10-20 03:37:21 +02:00
2022-10-20 03:37:21 +02:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-10-14 16:39:20 +01:00
2022-10-14 16:39:20 +01:00
2018-06-02 09:45:55 +02:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-06-27 17:53:25 -04:00
2022-05-23 09:19:45 -04:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-06-29 16:05:09 +02:00
2022-10-09 19:39:58 -04:00
2022-06-01 12:44:23 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-09-15 03:43:04 +02:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-10-24 10:46:57 +01:00
2022-10-11 10:55:56 -04:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-22 01:06:37 +00:00
2022-05-22 01:06:37 +00:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-06-23 10:47:22 +01:00
2022-06-23 10:47:22 +01:00
2022-06-23 10:47:22 +01:00
2022-05-18 09:19:02 +01:00
2022-07-25 01:00:54 +02:00
2022-07-25 01:00:54 +02:00
2022-07-05 10:41:49 +01:00
2022-05-18 09:19:02 +01:00
2020-11-17 15:50:07 +00:00
2018-08-25 23:59:45 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-09-15 01:18:42 +02:00
2022-09-19 14:35:45 +00:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2018-01-04 22:19:30 +01:00
2019-08-24 19:14:05 +00:00
2022-10-17 15:17:32 +02:00
2013-01-13 13:11:57 -05:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-10-13 20:53:56 -04:00
2022-05-18 09:19:02 +01:00
2022-08-02 12:35:56 -07:00
2022-05-27 12:58:10 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-07-25 22:30:22 +01:00
2022-08-19 08:29:36 -04:00
2022-05-18 09:19:02 +01:00
2022-10-19 09:23:52 +00:00
2022-05-18 09:19:02 +01:00
2021-09-21 09:41:29 +00:00
2022-05-22 01:06:37 +00:00
2022-05-22 01:06:37 +00:00
2022-05-18 09:19:02 +01:00
2022-07-13 15:58:24 +01:00
2021-11-18 14:32:09 +00:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-10-13 13:54:24 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-10-18 15:05:30 +01:00
2022-07-20 20:48:17 +00:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-09-15 03:43:04 +02:00
2022-05-22 01:06:37 +00:00
2022-05-22 01:06:37 +00:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-08-02 18:47:05 +02:00
2022-10-20 11:55:08 +00:00
2022-05-18 14:40:23 +00:00
2022-05-18 09:19:02 +01:00
2022-10-20 11:55:08 +00:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-10-19 14:53:45 +01:00
2022-10-17 14:40:31 +02:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2020-06-12 15:01:08 +01:00
2022-05-18 09:19:02 +01:00
2022-06-23 10:47:13 +01:00
2022-06-23 10:47:13 +01:00
2022-07-12 14:30:20 +02:00
2022-09-20 20:28:53 +05:30
2022-06-23 20:01:12 +02:00
2022-05-22 01:06:37 +00:00
2022-07-11 19:56:26 +02:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-10-18 08:59:24 -04:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2014-02-20 18:27:24 -05:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-22 01:06:37 +00:00
2022-05-22 01:06:37 +00:00
2022-10-17 15:17:32 +02:00
2022-05-18 09:19:02 +01:00
2022-09-15 03:43:04 +02:00
2022-09-15 03:43:04 +02:00
2022-09-15 03:43:04 +02:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-09-15 03:43:04 +02:00
2022-05-18 09:19:02 +01:00
2022-09-15 03:43:04 +02:00
2022-09-15 03:43:04 +02:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-10-20 03:37:21 +02:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2021-05-03 15:09:31 +02:00
2017-02-06 14:40:38 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-10-18 14:52:32 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-10-05 06:47:26 +00:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-10-13 20:53:56 -04:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2022-05-18 09:19:02 +01:00
2016-05-23 10:52:10 -04:00
2022-10-13 20:53:56 -04:00
2020-11-17 15:50:07 +00:00
2022-10-20 03:37:21 +02:00
2022-02-11 14:45:42 +00:00