vkd3d-shader/hlsl: Return an "error" expression when using an undeclared variable.

This commit is contained in:
Elizabeth Figura 2024-08-29 12:48:23 -05:00 committed by Henri Verbeet
parent 67093c5833
commit 5d52bef19d
Notes: Henri Verbeet 2024-10-03 19:34:42 +02:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1110

View File

@ -8682,7 +8682,11 @@ primary_expr:
else else
{ {
hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_NOT_DEFINED, "Identifier \"%s\" is not declared.", $1); hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_NOT_DEFINED, "Identifier \"%s\" is not declared.", $1);
vkd3d_free($1);
if (!($$ = make_empty_block(ctx)))
YYABORT; YYABORT;
$$->value = ctx->error_instr;
} }
} }