Module: vkd3d Branch: master Commit: 28dff58fb5e79d034afe0d1def3bcfa42d1d5cb4 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/28dff58fb5e79d034afe0d1def3bcf...
Author: Zebediah Figura zfigura@codeweavers.com Date: Mon Nov 14 19:56:07 2022 -0600
vkd3d-shader/hlsl: Return a hlsl_block from the "initializer_expr" rule.
---
libs/vkd3d-shader/hlsl.y | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 8bbd9365..2639297b 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -4570,7 +4570,6 @@ static void validate_texture_format_type(struct hlsl_ctx *ctx, struct hlsl_type %type <list> declaration %type <list> declaration_statement %type <list> equality_expr -%type <list> initializer_expr %type <list> logicand_expr %type <list> logicor_expr %type <list> mul_expr @@ -4603,6 +4602,7 @@ static void validate_texture_format_type(struct hlsl_ctx *ctx, struct hlsl_type %type <block> expr %type <block> expr_optional %type <block> expr_statement +%type <block> initializer_expr %type <block> jump_statement %type <block> loop_statement %type <block> selection_statement @@ -5824,11 +5824,11 @@ complex_initializer: $$.args_count = 1; if (!($$.args = hlsl_alloc(ctx, sizeof(*$$.args)))) { - destroy_instr_list($1); + destroy_block($1); YYABORT; } - $$.args[0] = node_from_list($1); - $$.instrs = list_to_block($1); + $$.args[0] = node_from_block($1); + $$.instrs = $1; $$.braces = false; } | '{' complex_initializer_list '}' @@ -5865,9 +5865,6 @@ complex_initializer_list:
initializer_expr: assignment_expr - { - $$ = block_to_list($1); - }
initializer_expr_list: initializer_expr @@ -5875,11 +5872,11 @@ initializer_expr_list: $$.args_count = 1; if (!($$.args = hlsl_alloc(ctx, sizeof(*$$.args)))) { - destroy_instr_list($1); + destroy_block($1); YYABORT; } - $$.args[0] = node_from_list($1); - $$.instrs = list_to_block($1); + $$.args[0] = node_from_block($1); + $$.instrs = $1; $$.braces = false; } | initializer_expr_list ',' initializer_expr @@ -5890,13 +5887,13 @@ initializer_expr_list: if (!(new_args = hlsl_realloc(ctx, $$.args, ($$.args_count + 1) * sizeof(*$$.args)))) { free_parse_initializer(&$$); - destroy_instr_list($3); + destroy_block($3); YYABORT; } $$.args = new_args; - $$.args[$$.args_count++] = node_from_list($3); - list_move_tail(&$$.instrs->instrs, $3); - vkd3d_free($3); + $$.args[$$.args_count++] = node_from_block($3); + hlsl_block_add_block($$.instrs, $3); + destroy_block($3); }
boolean: