aboutsummaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2020-04-09 14:11:51 -0700
committerMarge Bot <[email protected]>2020-04-29 19:46:08 +0000
commit5bcaf30aba08b718e913b10745df5e92854ed5b6 (patch)
treea364efd748df05be2502752803c51aed0e704d4b /src/util
parentfc66800032946c53a01c979ee3b69ac2ba989222 (diff)
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 <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4537>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/register_allocate.c1
1 files changed, 1 insertions, 0 deletions
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.