On 3/9/22 14:10, Francisco Casas wrote:
Hi,
March 9, 2022 3:51 PM, "Zebediah Figura" zfigura@codeweavers.com wrote:
@@ -3240,7 +3243,11 @@ initializer_expr_list: { $$ = $1; if (!($$.args = hlsl_realloc(ctx, $$.args, ($$.args_count + 1) * sizeof(*$$.args))))
- {
- free_parse_initializer(&$$);
- destroy_instr_list($3);
YYABORT;
- }
$$.args[$$.args_count++] = node_from_list($3); list_move_tail($$.instrs, $3); vkd3d_free($3);
Unfortunately this still leaks the old $$.args (or $1.args). We should probably be using array_reserve() here. There's a similar problem with 3/8.
If I am not mistaken, free_parse_initializer(&$$) takes care of that. Currently its definition is:
static void free_parse_initializer(struct parse_initializer *initializer) { destroy_instr_list(initializer->instrs); vkd3d_free(initializer->args); }
Same for 3/8. Unless I am missing something...
The problem is that you're assigning $$.args to NULL, so nothing is actually freed.