Module: Mesa
Branch: master
Commit: 19db71807f9ad9af8cc994705a18e9dd06f72b5d
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=19db71807f9ad9af8cc994705a18e9dd06f72b5d

Author: Connor Abbott <cwabbo...@gmail.com>
Date:   Sat Nov 14 20:24:31 2015 -0500

util/hash_table: don't compare deleted entries

The equivalent of the last patch for the hash table. I'm not aware of
any issues this fixes.

v2:
- use entry_is_deleted (Timothy)

Reviewed-by: Timothy Arceri <timothy.arc...@collabora.com>
Signed-off-by: Connor Abbott <cwabbo...@gmail.com>

---

 src/util/hash_table.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/util/hash_table.c b/src/util/hash_table.c
index 3247593..3ec65af 100644
--- a/src/util/hash_table.c
+++ b/src/util/hash_table.c
@@ -300,7 +300,8 @@ hash_table_insert(struct hash_table *ht, uint32_t hash,
        * required to avoid memory leaks, perform a search
        * before inserting.
        */
-      if (entry->hash == hash &&
+      if (!entry_is_deleted(ht, entry) &&
+          entry->hash == hash &&
           ht->key_equals_function(key, entry->key)) {
          entry->key = key;
          entry->data = data;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to