nir: Duplicate the name in nir_def_set_name

nir_sweep expects that nir_instr_debug_info::variable_name is owned by
nir_instr_debug_info.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40706>
This commit is contained in:
Konstantin Seurer 2026-03-30 15:29:20 +02:00
parent 9c596cd05b
commit f48f681fb5

View file

@ -607,7 +607,7 @@ nir_def_set_name(nir_shader *shader, nir_def *def, char *name)
return;
nir_instr_debug_info *debug_info = nir_instr_get_debug_info(nir_def_instr(def));
debug_info->variable_name = name;
debug_info->variable_name = ralloc_strdup(shader, name);
}
/* Performs variable renaming