disk_cache: assert if a cache entries keys don't match mesa

In ef42423e7b I enabled the check for release builds however we
still want to assert in debug builds in case of collisions or
just general bugs with the key building/compare code. Otherwise
it will just fail silently effectively disabling the cache.

Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
This commit is contained in:
Timothy Arceri 2017-08-25 14:04:19 +10:00
parent d500c9b060
commit 2422124f6e
1 changed files with 3 additions and 1 deletions

View File

@ -1085,8 +1085,10 @@ disk_cache_get(struct disk_cache *cache, const cache_key key, size_t *size)
goto fail;
/* Check for extremely unlikely hash collisions */
if (memcmp(cache->driver_keys_blob, file_header, ck_size) != 0)
if (memcmp(cache->driver_keys_blob, file_header, ck_size) != 0) {
assert(!"Mesa cache keys mismatch!");
goto fail;
}
size_t cache_item_md_size = sizeof(uint32_t);
uint32_t md_type;