Mesa (staging/20.1): util/ra: Sanity check that the driver selected a valid reg.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Apr 29 21:20:09 UTC 2020
Module: Mesa
Branch: staging/20.1
Commit: 5bcaf30aba08b718e913b10745df5e92854ed5b6
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5bcaf30aba08b718e913b10745df5e92854ed5b6
Author: Eric Anholt <eric at anholt.net>
Date: Thu Apr 9 14:11:51 2020 -0700
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 <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4537>
---
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.
More information about the mesa-commit
mailing list