summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-07-03 16:24:26 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-07-03 17:21:23 -0600
commit7366f3fc54be280969f3adef16ed67fddfe55e67 (patch)
tree71707117c423a011fd4406c50d3d6bed983e4d97 /src/mesa/shader/slang
parent0ed3f6f575ebdb345ad9891380686eafce63c75e (diff)
mesa: fix incorrect array size, added assertion
Diffstat (limited to 'src/mesa/shader/slang')
-rw-r--r--src/mesa/shader/slang/slang_vartable.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_vartable.c b/src/mesa/shader/slang/slang_vartable.c
index 26411255df..bb4d2d656c 100644
--- a/src/mesa/shader/slang/slang_vartable.c
+++ b/src/mesa/shader/slang/slang_vartable.c
@@ -28,7 +28,7 @@ struct table
slang_variable **Vars; /* array [NumVars] */
TempState Temps[MAX_PROGRAM_TEMPS * 4]; /* per-component state */
- int ValSize[MAX_PROGRAM_TEMPS]; /* For debug only */
+ int ValSize[MAX_PROGRAM_TEMPS * 4]; /**< For debug only */
struct table *Parent; /** Parent scope table */
};
@@ -220,6 +220,7 @@ alloc_reg(slang_var_table *vt, GLint size, GLboolean isTemp)
assert(i % 4 == 0);
for (j = 0; j < size; j++)
t->Temps[i + j] = isTemp ? TEMP : VAR;
+ assert(i < MAX_PROGRAM_TEMPS * 4);
t->ValSize[i] = size;
return i;
}