mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
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:
parent
55058652b8
commit
dd24501665
2 changed files with 2 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue