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.
/* 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 {
}
| 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 {