From f0109e9ac01b9747d28dbc482b0ec5e0ef9f2dfd Mon Sep 17 00:00:00 2001 From: Icecream95 Date: Tue, 29 Dec 2020 00:49:36 +1300 Subject: [PATCH] panfrost: Assert on sysval overflow Reviewed-by: Alyssa Rosenzweig Part-of: --- src/panfrost/util/pan_sysval.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/panfrost/util/pan_sysval.c b/src/panfrost/util/pan_sysval.c index f28d3a1..80e4469 100644 --- a/src/panfrost/util/pan_sysval.c +++ b/src/panfrost/util/pan_sysval.c @@ -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; } -- 2.7.4