[PATCH vkd3d 1/2] vkd3d-shader/hlsl: Fix a memory leak.
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com> --- libs/vkd3d-shader/hlsl_codegen.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 9efc3dad..41ba824d 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -1014,6 +1014,7 @@ static void allocate_temp_registers(struct hlsl_ctx *ctx, struct hlsl_ir_functio struct liveness liveness = {0}; allocate_temp_registers_recurse(ctx, entry_func->body, &liveness); ctx->temp_count = liveness.reg_count; + vkd3d_free(liveness.regs); } static void allocate_semantic_register(struct hlsl_ctx *ctx, struct hlsl_ir_var *var, unsigned int *counter, bool output) -- 2.33.0
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com> --- libs/vkd3d-shader/hlsl.y | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index e9eac555..ecbbd4fc 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -2979,6 +2979,7 @@ postfix_expr: { hlsl_error(ctx, @1, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER, "Modifiers are not allowed on constructors."); + free_parse_initializer(&$4); YYABORT; } if ($2->type > HLSL_CLASS_LAST_NUMERIC) @@ -2989,6 +2990,7 @@ postfix_expr: hlsl_error(ctx, @2, VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE, "Constructor data type %s is not numeric.", string->buffer); hlsl_release_string_buffer(ctx, string); + free_parse_initializer(&$4); YYABORT; } if ($2->dimx * $2->dimy != initializer_size(&$4)) @@ -2996,6 +2998,7 @@ postfix_expr: hlsl_error(ctx, @4, VKD3D_SHADER_ERROR_HLSL_WRONG_PARAMETER_COUNT, "Expected %u components in constructor, but got %u.", $2->dimx * $2->dimy, initializer_size(&$4)); + free_parse_initializer(&$4); YYABORT; } -- 2.33.0
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
participants (3)
-
Giovanni Mascellani -
Henri Verbeet -
Zebediah Figura (she/her)