summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2019-03-06 12:30:22 +0200
committerTapani Pälli <[email protected]>2019-03-07 07:40:19 +0200
commit8b010f35578205eecbe574e8ef3914b398ba0b55 (patch)
treedb6f58ff76d31d3a846d30a7d8d23d0f43f11366 /src
parent4900c0cff4cc1a5966d70402a8ee01b7495d3a0e (diff)
nir: free dead_ctx in case of no progress
Fixes a leak: ==7576== 320 (48 direct, 272 indirect) bytes in 1 blocks are definitely lost in loss record 26 of 26 ==7576== at 0x4C2EE3B: malloc (vg_replace_malloc.c:309) ==7576== by 0x53EF0E4: ralloc_size (ralloc.c:119) ==7576== by 0x53EF0C2: ralloc_context (ralloc.c:113) ==7576== by 0x5471F64: nir_split_per_member_structs (nir_split_per_member_structs.c:176) ==7576== by 0x51288CF: anv_shader_compile_to_nir (anv_pipeline.c:216) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/nir/nir_split_per_member_structs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_split_per_member_structs.c b/src/compiler/nir/nir_split_per_member_structs.c
index c4de52d1461..592225ba644 100644
--- a/src/compiler/nir/nir_split_per_member_structs.c
+++ b/src/compiler/nir/nir_split_per_member_structs.c
@@ -183,8 +183,10 @@ nir_split_per_member_structs(nir_shader *shader)
var_to_member_map, dead_ctx);
progress |= split_variables_in_list(&shader->system_values, shader,
var_to_member_map, dead_ctx);
- if (!progress)
+ if (!progress) {
+ ralloc_free(dead_ctx);
return false;
+ }
nir_foreach_function(function, shader) {
if (!function->impl)