From 1dc20c7916e873dd154d62f885f849c87211c192 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 3 Jul 2008 13:03:35 -0600 Subject: [PATCH] mesa: fix incorrect array size, added assertion --- src/mesa/shader/slang/slang_vartable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/shader/slang/slang_vartable.c b/src/mesa/shader/slang/slang_vartable.c index 1d817000c60..c4a2f784d4d 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; } -- 2.30.2