Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.y:
}
else
{
v->arrays.sizes[i] = size / elem_components; }
type = hlsl_new_array_type(ctx, type, v->arrays.sizes[i]); }
type = hlsl_new_array_type(ctx, type, v->arrays.sizes[i]); }
vkd3d_free(v->arrays.sizes);
- }
- if (!(var_name = vkd3d_strdup(v->name)))
return;
- if (!(var = hlsl_new_var(ctx, var_name, type, &v->loc, &v->semantic, modifiers, &v->reg_reservation)))
I'm not convinced ownership for `semantic->name` is handled correctly. Here `hlsl_new_var()` acquires ownership of the name, but at the same time it seems that the `struct parse_variable_def` still retains it (given that `free_parse_variable_def()` is called in `initialize_vars()`). Am I missing something?