broadcom/compiler: free defin and defout arrays if they already exist
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 5 Jul 2023 08:40:34 +0000 (10:40 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 5 Jul 2023 21:52:01 +0000 (21:52 +0000)
Just like we do for everything else here, since we are going to realloc
them again right below. Notice this is not exactly a memory leak, since
all these arrays are allocated with ralloc using v3d_compile as context,
so all allocations will be eventually freed when the context is destroyed.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24001>

src/broadcom/compiler/vir_live_variables.c

index 2fd6430..575b048 100644 (file)
@@ -306,6 +306,8 @@ vir_calculate_live_intervals(struct v3d_compile *c)
 
                 vir_for_each_block(block, c) {
                         ralloc_free(block->def);
+                        ralloc_free(block->defin);
+                        ralloc_free(block->defout);
                         ralloc_free(block->use);
                         ralloc_free(block->live_in);
                         ralloc_free(block->live_out);