From ef764a24b2a72123b25e829272b6aac596224cee Mon Sep 17 00:00:00 2001 From: LoopDawg Date: Fri, 3 Jun 2016 09:17:51 -0600 Subject: [PATCH] Fix for empty statement segfault. --- Test/hlsl.intrinsics.vert | 6 +++--- hlsl/hlslGrammar.cpp | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Test/hlsl.intrinsics.vert b/Test/hlsl.intrinsics.vert index 73243420..efafb4ac 100644 --- a/Test/hlsl.intrinsics.vert +++ b/Test/hlsl.intrinsics.vert @@ -298,7 +298,7 @@ float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2) float2x2 VertexShaderFunction(float2x2 inF0, float2x2 inF1, float2x2 inF2) { // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. - MATFNS() + MATFNS(); // TODO: ... add when float1 prototypes are generated return float2x2(2,2,2,2); @@ -307,7 +307,7 @@ float2x2 VertexShaderFunction(float2x2 inF0, float2x2 inF1, float2x2 inF2) float3x3 VertexShaderFunction(float3x3 inF0, float3x3 inF1, float3x3 inF2) { // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. - MATFNS() + MATFNS(); // TODO: ... add when float1 prototypes are generated return float3x3(3,3,3,3,3,3,3,3,3); @@ -316,7 +316,7 @@ float3x3 VertexShaderFunction(float3x3 inF0, float3x3 inF1, float3x3 inF2) float4x4 VertexShaderFunction(float4x4 inF0, float4x4 inF1, float4x4 inF2) { // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. - MATFNS() + MATFNS(); // TODO: ... add when float1 prototypes are generated return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4); diff --git a/hlsl/hlslGrammar.cpp b/hlsl/hlslGrammar.cpp index 443db4ba..a6387b74 100755 --- a/hlsl/hlslGrammar.cpp +++ b/hlsl/hlslGrammar.cpp @@ -492,6 +492,8 @@ bool HlslGrammar::acceptFunctionDefinition(TFunction& function, TIntermNode*& no // bool HlslGrammar::acceptExpression(TIntermTyped*& node) { + node = nullptr; + // assignment_expression if (! acceptAssignmentExpression(node)) return false;