diff options
author | Tapani Pälli <tapani.palli@intel.com> | 2016-08-19 14:33:13 +0300 |
---|---|---|
committer | Tapani Pälli <tapani.palli@intel.com> | 2016-08-22 07:37:55 +0300 |
commit | 0abebec01246cb55dba76330a759e14424dae169 (patch) | |
tree | 2e8f7b3b6539379b9ab24c68845b75d67e541541 /src/util | |
parent | 68233801aeb73961cd47dbba276e5d6fcf5411fc (diff) |
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>
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/hash_table.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/util/hash_table.c b/src/util/hash_table.c index 4cfe3d9325..9e643af8b2 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) { |