From 84685fb56d47b933a861e650636b0af3fb10187e Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Thu, 29 Aug 2024 12:48:23 -0500 Subject: [PATCH] vkd3d-shader/hlsl: Handle error expressions in subscripts. --- libs/vkd3d-shader/hlsl.y | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index a42199c4..ed5aab3b 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -8810,7 +8810,6 @@ postfix_expr: YYABORT; } vkd3d_free($3); - $$ = $1; } else if (hlsl_is_numeric_type(node->data_type)) { @@ -8824,14 +8823,14 @@ postfix_expr: } hlsl_block_add_instr($1, swizzle); vkd3d_free($3); - $$ = $1; } - else + else if (node->data_type->class != HLSL_CLASS_ERROR) { hlsl_error(ctx, &@3, VKD3D_SHADER_ERROR_HLSL_INVALID_SYNTAX, "Invalid subscript \"%s\".", $3); vkd3d_free($3); YYABORT; } + $$ = $1; } | postfix_expr '[' expr ']' {