From 79dd9544b7233ef5704f01db3c73bea77faebd9f Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 14 Nov 2022 19:10:38 -0600 Subject: [PATCH] vkd3d-shader/hlsl: Return a hlsl_block from the "loop_statement" rule. --- libs/vkd3d-shader/hlsl.y | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index c8b7e255..a2f2f373 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -486,7 +486,8 @@ static bool attribute_list_has_duplicates(const struct parse_attribute_list *att return false; } -static struct list *create_loop(struct hlsl_ctx *ctx, enum loop_type type, const struct parse_attribute_list *attributes, struct list *init, struct list *cond, +static struct hlsl_block *create_loop(struct hlsl_ctx *ctx, enum loop_type type, + const struct parse_attribute_list *attributes, struct list *init, struct list *cond, struct list *iter, struct hlsl_block *body, const struct vkd3d_shader_location *loc) { struct hlsl_ir_node *loop; @@ -542,7 +543,7 @@ static struct list *create_loop(struct hlsl_ctx *ctx, enum loop_type type, const vkd3d_free(cond); destroy_block(body); - return init; + return list_to_block(init); oom: destroy_instr_list(init); @@ -4571,7 +4572,6 @@ static void validate_texture_format_type(struct hlsl_ctx *ctx, struct hlsl_type %type jump_statement %type logicand_expr %type logicor_expr -%type loop_statement %type mul_expr %type postfix_expr %type primary_expr @@ -4599,6 +4599,7 @@ static void validate_texture_format_type(struct hlsl_ctx *ctx, struct hlsl_type %type attribute_list_optional %type compound_statement +%type loop_statement %type statement %type statement_list @@ -5932,9 +5933,6 @@ statement: $$ = list_to_block($1); } | loop_statement - { - $$ = list_to_block($1); - } jump_statement: KW_RETURN expr ';'