From 5d52bef19d1f8cb1ae6bad30b5aeb2508356426c Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Thu, 29 Aug 2024 12:48:23 -0500 Subject: [PATCH] vkd3d-shader/hlsl: Return an "error" expression when using an undeclared variable. --- libs/vkd3d-shader/hlsl.y | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index b4d9f098..8fce78d6 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -8682,7 +8682,11 @@ primary_expr: else { hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_NOT_DEFINED, "Identifier \"%s\" is not declared.", $1); - YYABORT; + vkd3d_free($1); + + if (!($$ = make_empty_block(ctx))) + YYABORT; + $$->value = ctx->error_instr; } }