From: John Kessenich Date: Thu, 9 Mar 2017 01:53:51 +0000 (-0700) Subject: HLSL: Non-functional: Don't process function name/parameters before expected a functi... X-Git-Tag: upstream/11.4.0~1275 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=78388726ebb2d41511b11ec84cb3368851416374;p=platform%2Fupstream%2Fglslang.git HLSL: Non-functional: Don't process function name/parameters before expected a function declaration. --- diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index ad84448..5dc46ee 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -2,5 +2,5 @@ // For the version, it uses the latest git tag followed by the number of commits. // For the date, it uses the current date (when then script is run). -#define GLSLANG_REVISION "Overload400-PrecQual.1882" -#define GLSLANG_DATE "07-Mar-2017" +#define GLSLANG_REVISION "Overload400-PrecQual.1885" +#define GLSLANG_DATE "08-Mar-2017" diff --git a/hlsl/hlslGrammar.cpp b/hlsl/hlslGrammar.cpp index 9641e31..01f9c12 100755 --- a/hlsl/hlslGrammar.cpp +++ b/hlsl/hlslGrammar.cpp @@ -326,14 +326,20 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList) HlslToken idToken; TIntermAggregate* initializers = nullptr; while (acceptIdentifier(idToken)) { - TString* fnName = idToken.string; + if (peekTokenClass(EHTokLeftParen)) { + // looks like function parameters + TString* fnName = idToken.string; - // Potentially rename shader entry point function. No-op most of the time. - parseContext.renameShaderFunction(fnName); + // Potentially rename shader entry point function. No-op most of the time. + parseContext.renameShaderFunction(fnName); + + // function_parameters + TFunction& function = *new TFunction(fnName, declaredType); + if (!acceptFunctionParameters(function)) { + expected("function parameter list"); + return false; + } - // function_parameters - TFunction& function = *new TFunction(fnName, declaredType); - if (acceptFunctionParameters(function)) { // post_decls acceptPostDecls(function.getWritableType().getQualifier());