summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-03-27 16:19:27 -0700
committerKenneth Graunke <[email protected]>2015-04-02 14:19:58 -0700
commitf61b6c3e48071991c098aa588ee86473f419d5c0 (patch)
treeae1e0c866ca6fa5201b04d6516caa8defffdf8a2
parentf4e449108060dcaea1b4e1e445b76a8ef43d3a05 (diff)
nir: Free dead variables when removing them.
Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r--src/glsl/nir/nir_remove_dead_variables.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/glsl/nir/nir_remove_dead_variables.c b/src/glsl/nir/nir_remove_dead_variables.c
index baa321e28db..4417e2a4883 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);
+ }
}
}