panfrost: Assert on sysval overflow

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8358>
This commit is contained in:
Icecream95 2020-12-29 00:49:36 +13:00 committed by Marge Bot
parent 24867386ee
commit f0109e9ac0
1 changed files with 1 additions and 0 deletions

View File

@ -123,6 +123,7 @@ panfrost_nir_assign_sysval_body(struct panfrost_sysvals *ctx, nir_instr *instr)
/* It hasn't -- so assign it now! */
unsigned id = ctx->sysval_count++;
assert(id < MAX_SYSVAL_COUNT);
_mesa_hash_table_u64_insert(ctx->sysval_to_id, sysval, (void *) ((uintptr_t) id + 1));
ctx->sysvals[id] = sysval;
}