[Mesa-dev] [PATCH v2 1/5] util/hash_table: Fix hashing in clears on 32-bit

Caio Marcelo de Oliveira Filho caio.oliveira at intel.com
Wed Aug 7 18:02:21 UTC 2019


On Wed, Aug 07, 2019 at 10:36:53AM +0200, Tomeu Vizoso wrote:
> Some hash functions (eg. key_u64_hash) will attempt to dereference the
> key, causing an invalid access when passed DELETED_KEY_VALUE (0x1) or
> FREED_KEY_VALUE (0x0).
> 
> To avoid this problem, stuff the fake keys into a hash_key_u64 struct
> and pass the pointer to it instead.

A more precise description would be something along the lines

   When in 32-bit arch a 64-bit key value doesn't fit into a pointer,
   so hash_table_u64 internally use a pointer to a struct containing
   the 64-bit key value.

   Fix _mesa_hash_table_u64_clear() to handle the 32-bit case by
   creating a temporary hash_key_u64 to pass to the hash function.


This patch is

   Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>


	Caio


More information about the mesa-dev mailing list