mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
do bounds check in _slang_push_var_table(), added comment
This commit is contained in:
parent
2585b74e19
commit
272622a2e0
1 changed files with 3 additions and 1 deletions
|
|
@ -32,6 +32,8 @@ struct slang_var_table_
|
|||
|
||||
/**
|
||||
* Create new table, put at head, return ptr to it.
|
||||
* XXX we should take a maxTemps parameter to indicate how many temporaries
|
||||
* are available for the current shader/program target.
|
||||
*/
|
||||
slang_var_table *
|
||||
_slang_push_var_table(slang_var_table *parent)
|
||||
|
|
@ -139,7 +141,7 @@ alloc_reg(slang_var_table *t, GLint size, GLboolean isTemp)
|
|||
for (i = 0; i < MAX_PROGRAM_TEMPS; i++) {
|
||||
GLuint found = 0;
|
||||
for (j = 0; j < sz4; j++) {
|
||||
if (!t->temps[i + j]) {
|
||||
if (i + j < MAX_PROGRAM_TEMPS && !t->temps[i + j]) {
|
||||
found++;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue