summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-08-25 14:04:19 +1000
committerTimothy Arceri <[email protected]>2017-08-28 09:29:15 +1000
commit2422124f6ee7d60b519b0fa7eeab9340901fd1d9 (patch)
treef6158a08edce1e7ff5e7a1bf301a1f4ad94ec248 /src
parentd500c9b060e1715e8d3a984d4a5c6f6179f46943 (diff)
disk_cache: assert if a cache entries keys don't match mesa
In ef42423e7be9 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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/util/disk_cache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index 36c1e8e72c6..b789a454eb0 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -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;