From: Tapani Pälli Date: Fri, 19 Aug 2016 11:33:13 +0000 (+0300) Subject: util: add assert that key cannot be NULL on insertion X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0abebec01246cb55dba76330a759e14424dae169;p=mesa.git util: add assert that key cannot be NULL on insertion Signed-off-by: Tapani Pälli Reviewed-by: Jason Ekstrand Reviewed-by: Eric Anholt --- diff --git a/src/util/hash_table.c b/src/util/hash_table.c index 4cfe3d93251..9e643af8b23 100644 --- a/src/util/hash_table.c +++ b/src/util/hash_table.c @@ -295,6 +295,8 @@ hash_table_insert(struct hash_table *ht, uint32_t hash, uint32_t start_hash_address, hash_address; struct hash_entry *available_entry = NULL; + assert(key != NULL); + if (ht->entries >= ht->max_entries) { _mesa_hash_table_rehash(ht, ht->size_index + 1); } else if (ht->deleted_entries + ht->entries >= ht->max_entries) {