ARB prog parser: more detailed error message for out of bounds ADDR offsets
authorBrian Paul <brianp@vmware.com>
Mon, 14 Sep 2009 23:34:09 +0000 (17:34 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 15 Sep 2009 15:40:25 +0000 (09:40 -0600)
src/mesa/shader/program_parse.y

index 06c1915fbee9c93322bbee6dd4cb3b914ee619be..89da91064b2b330aa923570c19e5875ccac501d5 100644 (file)
@@ -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;