summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-09-14 17:34:09 -0600
committerBrian Paul <brianp@vmware.com>2009-09-15 09:40:25 -0600
commit2aad3a855b8422124f9c903fa2096ea1fe0a607f (patch)
treebd84d014e5d33ccf52aa2835c93793aaf0ad0a4b
parent5ef40337ab9f0cf5d9184ac541157e5ef4209897 (diff)
ARB prog parser: more detailed error message for out of bounds ADDR offsets
-rw-r--r--src/mesa/shader/program_parse.y12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y
index 06c1915fbe..89da91064b 100644
--- a/src/mesa/shader/program_parse.y
+++ b/src/mesa/shader/program_parse.y
@@ -806,8 +806,10 @@ addrRegRelOffset: { $$ = 0; }
addrRegPosOffset: INTEGER
{
if (($1 < 0) || ($1 > 63)) {
- yyerror(& @1, state,
- "relative address offset too large (positive)");
+ char s[100];
+ _mesa_snprintf(s, sizeof(s),
+ "relative address offset too large (%d)", $1);
+ yyerror(& @1, state, s);
YYERROR;
} else {
$$ = $1;
@@ -818,8 +820,10 @@ addrRegPosOffset: INTEGER
addrRegNegOffset: INTEGER
{
if (($1 < 0) || ($1 > 64)) {
- yyerror(& @1, state,
- "relative address offset too large (negative)");
+ char s[100];
+ _mesa_snprintf(s, sizeof(s),
+ "relative address offset too large (%d)", $1);
+ yyerror(& @1, state, s);
YYERROR;
} else {
$$ = $1;