vtn: fix use-after-free on function parameter names
Fixes: 5d7a230324 ("vtn: gather function parameter names")
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35098>
This commit is contained in:
@@ -402,7 +402,7 @@ vtn_cfg_handle_prepass_instruction(struct vtn_builder *b, SpvOp opcode,
|
||||
struct vtn_ssa_value *ssa = vtn_create_ssa_value(b, type->type);
|
||||
struct vtn_value *val = vtn_untyped_value(b, w[2]);
|
||||
|
||||
b->func->nir_func->params[b->func_param_idx].name = val->name;
|
||||
b->func->nir_func->params[b->func_param_idx].name = ralloc_strdup(b->shader, val->name);
|
||||
|
||||
vtn_foreach_decoration(b, val, function_parameter_decoration_cb, &arg_info);
|
||||
vtn_ssa_value_load_function_param(b, ssa, type, &arg_info, &b->func_param_idx);
|
||||
|
||||
Reference in New Issue
Block a user