From: Giovanni Mascellani gmascellani@codeweavers.com
--- libs/vkd3d-shader/hlsl.y | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 8dc353e11..5926f4956 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -6992,8 +6992,10 @@ primary_expr: if (!(var = hlsl_get_var(ctx->cur_scope, $1))) { hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_NOT_DEFINED, "Variable "%s" is not defined.", $1); + vkd3d_free($1); YYABORT; } + vkd3d_free($1); if (!(load = hlsl_new_var_load(ctx, var, &@1))) YYABORT; if (!($$ = make_block(ctx, &load->node)))
From: Giovanni Mascellani gmascellani@codeweavers.com
--- 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 6249808a5..06aa51a8d 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -5807,7 +5807,11 @@ func_prototype: } else { - free($1.attrs); + unsigned int i; + + for (i = 0; i < $1.count; ++i) + hlsl_free_attribute((void *)$1.attrs[i]); + vkd3d_free($1.attrs); } $$ = $2; }
From: Giovanni Mascellani gmascellani@codeweavers.com
--- libs/vkd3d-shader/hlsl.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 5926f4956..6249808a5 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -5572,11 +5572,11 @@ attribute: $$->name = $2; hlsl_block_init(&$$->instrs); hlsl_block_add_block(&$$->instrs, $4.instrs); - vkd3d_free($4.instrs); $$->loc = @$; $$->args_count = $4.args_count; for (i = 0; i < $4.args_count; ++i) hlsl_src_from_node(&$$->args[i], $4.args[i]); + free_parse_initializer(&$4); }
attribute_list:
From: Giovanni Mascellani gmascellani@codeweavers.com
--- libs/vkd3d-shader/hlsl.y | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 06aa51a8d..5f6334a4d 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -7073,12 +7073,17 @@ postfix_expr: if (!(field = get_struct_field(type->e.record.fields, type->e.record.field_count, $3))) { hlsl_error(ctx, &@3, VKD3D_SHADER_ERROR_HLSL_NOT_DEFINED, "Field "%s" is not defined.", $3); + vkd3d_free($3); YYABORT; }
field_idx = field - type->e.record.fields; if (!add_record_access(ctx, $1, node, field_idx, &@2)) + { + vkd3d_free($3); YYABORT; + } + vkd3d_free($3); $$ = $1; } else if (hlsl_is_numeric_type(node->data_type)) @@ -7088,14 +7093,17 @@ postfix_expr: if (!(swizzle = get_swizzle(ctx, node, $3, &@3))) { hlsl_error(ctx, &@3, VKD3D_SHADER_ERROR_HLSL_INVALID_SYNTAX, "Invalid swizzle "%s".", $3); + vkd3d_free($3); YYABORT; } hlsl_block_add_instr($1, swizzle); + vkd3d_free($3); $$ = $1; } else { hlsl_error(ctx, &@3, VKD3D_SHADER_ERROR_HLSL_INVALID_SYNTAX, "Invalid subscript "%s".", $3); + vkd3d_free($3); YYABORT; } }
From: Giovanni Mascellani gmascellani@codeweavers.com
--- tests/hlsl_d3d12.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/tests/hlsl_d3d12.c b/tests/hlsl_d3d12.c index 28007e3aa..b2273ffbc 100644 --- a/tests/hlsl_d3d12.c +++ b/tests/hlsl_d3d12.c @@ -525,6 +525,7 @@ static void test_thread_id(void) cs_code = compile_shader(cs_source, "cs_5_0"); context.pipeline_state = create_compute_pipeline_state(device, context.root_signature, shader_bytecode(ID3D10Blob_GetBufferPointer(cs_code), ID3D10Blob_GetBufferSize(cs_code))); + ID3D10Blob_Release(cs_code);
ID3D12GraphicsCommandList_SetPipelineState(command_list, context.pipeline_state); ID3D12GraphicsCommandList_SetComputeRootSignature(command_list, context.root_signature);
This merge request was approved by Giovanni Mascellani.
This merge request was approved by Zebediah Figura.
This merge request was approved by Henri Verbeet.