From: Kenneth Graunke Date: Fri, 27 Mar 2015 23:19:27 +0000 (-0700) Subject: nir: Free dead variables when removing them. X-Git-Tag: upstream/17.1.0~19651 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f61b6c3e48071991c098aa588ee86473f419d5c0;p=platform%2Fupstream%2Fmesa.git nir: Free dead variables when removing them. Signed-off-by: Kenneth Graunke Reviewed-by: Jason Ekstrand --- diff --git a/src/glsl/nir/nir_remove_dead_variables.c b/src/glsl/nir/nir_remove_dead_variables.c index baa321e..4417e2a 100644 --- a/src/glsl/nir/nir_remove_dead_variables.c +++ b/src/glsl/nir/nir_remove_dead_variables.c @@ -102,8 +102,10 @@ remove_dead_vars(struct exec_list *var_list, struct set *live) { foreach_list_typed_safe(nir_variable, var, node, var_list) { struct set_entry *entry = _mesa_set_search(live, var); - if (entry == NULL) + if (entry == NULL) { exec_node_remove(&var->node); + ralloc_free(var); + } } }