util: add assert that key cannot be NULL on insertion

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Tapani Pälli 2016-08-19 14:33:13 +03:00
parent 68233801ae
commit 0abebec012

View file

@ -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) {