st/mesa: new assertions to check array indexes
This commit is contained in:
parent
c2e87d7f07
commit
4ae2bdcb15
|
@ -181,6 +181,7 @@ src_register( struct st_translate *t,
|
||||||
ASSERT(index >= 0);
|
ASSERT(index >= 0);
|
||||||
if (ureg_dst_is_undef(t->temps[index]))
|
if (ureg_dst_is_undef(t->temps[index]))
|
||||||
t->temps[index] = ureg_DECL_temporary( t->ureg );
|
t->temps[index] = ureg_DECL_temporary( t->ureg );
|
||||||
|
assert(index < Elements(t->temps));
|
||||||
return ureg_src(t->temps[index]);
|
return ureg_src(t->temps[index]);
|
||||||
|
|
||||||
case PROGRAM_NAMED_PARAM:
|
case PROGRAM_NAMED_PARAM:
|
||||||
|
@ -197,9 +198,11 @@ src_register( struct st_translate *t,
|
||||||
return t->constants[index];
|
return t->constants[index];
|
||||||
|
|
||||||
case PROGRAM_INPUT:
|
case PROGRAM_INPUT:
|
||||||
|
assert(t->inputMapping[index] < Elements(t->inputs));
|
||||||
return t->inputs[t->inputMapping[index]];
|
return t->inputs[t->inputMapping[index]];
|
||||||
|
|
||||||
case PROGRAM_OUTPUT:
|
case PROGRAM_OUTPUT:
|
||||||
|
assert(t->outputMapping[index] < Elements(t->outputs));
|
||||||
return ureg_src(t->outputs[t->outputMapping[index]]); /* not needed? */
|
return ureg_src(t->outputs[t->outputMapping[index]]); /* not needed? */
|
||||||
|
|
||||||
case PROGRAM_ADDRESS:
|
case PROGRAM_ADDRESS:
|
||||||
|
|
Loading…
Reference in New Issue