GLSL: Fix #1229: merge array sizes in parameter declarations.
This commit is contained in:
parent
98e733cb58
commit
b3f9e0a334
5 changed files with 30 additions and 5 deletions
|
|
@ -3103,7 +3103,7 @@ void TParseContext::arrayDimCheck(const TSourceLoc& loc, const TType* type, cons
|
|||
//
|
||||
void TParseContext::arrayDimMerge(TType& type, const TArraySizes* sizes)
|
||||
{
|
||||
if (sizes)
|
||||
if (sizes != nullptr)
|
||||
type.addArrayOuterSizes(*sizes);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -902,9 +902,9 @@ parameter_declarator
|
|||
parseContext.arraySizeRequiredCheck($3.loc, *$3.arraySizes);
|
||||
parseContext.reservedErrorCheck($2.loc, *$2.string);
|
||||
|
||||
$1.arraySizes = $3.arraySizes;
|
||||
|
||||
TParameter param = { $2.string, new TType($1)};
|
||||
parseContext.arrayDimMerge(*param.type, $3.arraySizes);
|
||||
|
||||
$$.loc = $2.loc;
|
||||
$$.param = param;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4433,9 +4433,9 @@ yyreduce:
|
|||
parseContext.arraySizeRequiredCheck((yyvsp[0].interm).loc, *(yyvsp[0].interm).arraySizes);
|
||||
parseContext.reservedErrorCheck((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string);
|
||||
|
||||
(yyvsp[-2].interm.type).arraySizes = (yyvsp[0].interm).arraySizes;
|
||||
|
||||
TParameter param = { (yyvsp[-1].lex).string, new TType((yyvsp[-2].interm.type))};
|
||||
parseContext.arrayDimMerge(*param.type, (yyvsp[0].interm).arraySizes);
|
||||
|
||||
(yyval.interm).loc = (yyvsp[-1].lex).loc;
|
||||
(yyval.interm).param = param;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue