From: Eric Anholt Date: Thu, 9 Apr 2020 21:11:51 +0000 (-0700) Subject: util/ra: Sanity check that the driver selected a valid reg. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5bcaf30aba08b718e913b10745df5e92854ed5b6;p=mesa.git 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: --- 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.