From cf97e674abf98fe41f7276400ea75809e27539c9 Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Mon, 25 Aug 2025 18:20:47 +0200 Subject: [PATCH] ghash: Fix entry_is_big for CHERI architecture The entry_is_big function checks if an entry fits into a so-called small entry, i.e. into a guint. This optimizes space for hash tables on 64 bit system with hash tables containing 32 bit entries. This code actually checks if the highest 32 bits are set, which would become an issue with CHERI and its 128 bit pointers. Helps: #2842 --- glib/ghash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/ghash.c b/glib/ghash.c index e922e1a88..cd4951306 100644 --- a/glib/ghash.c +++ b/glib/ghash.c @@ -873,7 +873,7 @@ g_hash_table_maybe_resize (GHashTable *hash_table) static inline gboolean entry_is_big (gpointer v) { - return (((guintptr) v) >> ((BIG_ENTRY_SIZE - SMALL_ENTRY_SIZE) * 8)) != 0; + return (((guintptr) v) >> (SMALL_ENTRY_SIZE * 8)) != 0; } static inline gboolean