From 5bcaf30aba08b718e913b10745df5e92854ed5b6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 9 Apr 2020 14:11:51 -0700 Subject: [PATCH] util/ra: Sanity check that the driver selected a valid reg. freedreno was returning -1 when it didn't pick a reg from the given bitset due to an off-by-a-small-number error. Reviewed-by: Kenneth Graunke Part-of: --- src/util/register_allocate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/register_allocate.c b/src/util/register_allocate.c index faae56752cd..a65b5ea154f 100644 --- a/src/util/register_allocate.c +++ b/src/util/register_allocate.c @@ -865,6 +865,7 @@ ra_select(struct ra_graph *g) } r = g->select_reg_callback(n, select_regs, g->select_reg_callback_data); + assert(r < g->regs->count); } else { /* Find the lowest-numbered reg which is not used by a member * of the graph adjacent to us. -- 2.30.2