nir/clone: don't call ralloc_strdup with a NULL pointer for intrinsic names
No impact, but it was affecting my ralloc_strdup stats for nir_intrinsic_instr names. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36538>
This commit is contained in:
@@ -355,7 +355,8 @@ clone_intrinsic(clone_state *state, const nir_intrinsic_instr *itr)
|
||||
|
||||
nitr->num_components = itr->num_components;
|
||||
memcpy(nitr->const_index, itr->const_index, sizeof(nitr->const_index));
|
||||
nitr->name = ralloc_strdup(state->ns, itr->name);
|
||||
if (itr->name)
|
||||
nitr->name = ralloc_strdup(state->ns, itr->name);
|
||||
|
||||
for (unsigned i = 0; i < num_srcs; i++)
|
||||
__clone_src(state, &nitr->instr, &nitr->src[i], &itr->src[i]);
|
||||
|
||||
Reference in New Issue
Block a user