ARB prog parser: Fix parameter array size comparison

Array indexes are invalid when >= the maximum, but array sizes are
only in valid when > the maximum.  This prevented programs from
declaring a single maximum size array.

See the piglit vp-max-array test.
This commit is contained in:
Ian Romanick 2009-10-20 10:58:14 -07:00
parent 55058652b8
commit dd24501665
2 changed files with 2 additions and 2 deletions

View file

@ -3109,7 +3109,7 @@ yyreduce:
/* Line 1455 of yacc.c */
#line 1041 "program_parse.y"
{
if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) {
if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) > state->limits->MaxParameters)) {
yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size");
YYERROR;
} else {

View file

@ -1039,7 +1039,7 @@ optArraySize:
}
| INTEGER
{
if (($1 < 1) || ((unsigned) $1 >= state->limits->MaxParameters)) {
if (($1 < 1) || ((unsigned) $1 > state->limits->MaxParameters)) {
yyerror(& @1, state, "invalid parameter array size");
YYERROR;
} else {