projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2585b74
)
do bounds check in _slang_push_var_table(), added comment
author
Brian
<brian@yutani.localnet.net>
Thu, 18 Jan 2007 01:21:00 +0000
(18:21 -0700)
committer
Brian
<brian@yutani.localnet.net>
Thu, 18 Jan 2007 01:21:00 +0000
(18:21 -0700)
src/mesa/shader/slang/slang_vartable.c
patch
|
blob
|
history
diff --git
a/src/mesa/shader/slang/slang_vartable.c
b/src/mesa/shader/slang/slang_vartable.c
index f9121f740b26c205afbd8bc0dd0185da581e5900..6d2b4369d945897cddd65aa93516410b41977c2d 100644
(file)
--- a/
src/mesa/shader/slang/slang_vartable.c
+++ b/
src/mesa/shader/slang/slang_vartable.c
@@
-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 {