HLSL: Address #839: avoid crash by distinguishing between bad argument and no argument.
This commit is contained in:
parent
d1141843c0
commit
2aa12b1c05
@ -2926,11 +2926,16 @@ bool HlslGrammar::acceptArguments(TFunction* function, TIntermTyped*& arguments)
|
|||||||
if (! acceptTokenClass(EHTokLeftParen))
|
if (! acceptTokenClass(EHTokLeftParen))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// RIGHT_PAREN
|
||||||
|
if (acceptTokenClass(EHTokRightParen))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// must now be at least one expression...
|
||||||
do {
|
do {
|
||||||
// expression
|
// expression
|
||||||
TIntermTyped* arg;
|
TIntermTyped* arg;
|
||||||
if (! acceptAssignmentExpression(arg))
|
if (! acceptAssignmentExpression(arg))
|
||||||
break;
|
return false;
|
||||||
|
|
||||||
// hook it up
|
// hook it up
|
||||||
parseContext.handleFunctionArgument(function, arguments, arg);
|
parseContext.handleFunctionArgument(function, arguments, arg);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user