util/ra: Sanity check that we're adding a valid reg to a class.
BITSET_SET might not segfault on you right away if you're just slightly off, and an assert is nicer anyway. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4537>
This commit is contained in:
parent
5bcaf30aba
commit
a1de267a21
|
@ -371,6 +371,8 @@ ra_class_add_reg(struct ra_regs *regs, unsigned int c, unsigned int r)
|
||||||
{
|
{
|
||||||
struct ra_class *class = regs->classes[c];
|
struct ra_class *class = regs->classes[c];
|
||||||
|
|
||||||
|
assert(r < regs->count);
|
||||||
|
|
||||||
BITSET_SET(class->regs, r);
|
BITSET_SET(class->regs, r);
|
||||||
class->p++;
|
class->p++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue