summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-04-09 10:08:27 -0600
committerBrian Paul <[email protected]>2010-04-09 10:08:27 -0600
commit4ae2bdcb150aa87557c8f1648445e84bfb926986 (patch)
treeb7dbf9cc49a2a0fd57b29e3095a2aa354acf798f /src/mesa/state_tracker
parentc2e87d7f07ca17f2c1da026ca9b378d3e31f1913 (diff)
st/mesa: new assertions to check array indexes
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_mesa_to_tgsi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index ad7a2b87ea8..e8eb9ec3904 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -181,6 +181,7 @@ src_register( struct st_translate *t,
ASSERT(index >= 0);
if (ureg_dst_is_undef(t->temps[index]))
t->temps[index] = ureg_DECL_temporary( t->ureg );
+ assert(index < Elements(t->temps));
return ureg_src(t->temps[index]);
case PROGRAM_NAMED_PARAM:
@@ -197,9 +198,11 @@ src_register( struct st_translate *t,
return t->constants[index];
case PROGRAM_INPUT:
+ assert(t->inputMapping[index] < Elements(t->inputs));
return t->inputs[t->inputMapping[index]];
case PROGRAM_OUTPUT:
+ assert(t->outputMapping[index] < Elements(t->outputs));
return ureg_src(t->outputs[t->outputMapping[index]]); /* not needed? */
case PROGRAM_ADDRESS: