From 5ad28c8ff6a78082eaa836c2d475ffb6b0b6f08b Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 5 Apr 2023 00:03:27 +0200 Subject: [PATCH] ada: Fix memory leak in multi-dimensional array aggregate of Vector It comes from a superfluous adjustment for subarray components. gcc/ada/ * exp_aggr.adb (Initialize_Array_Component): Fix condition detecting the nested case that requires an adjustment. --- gcc/ada/exp_aggr.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 75e5e1402dff..c4a016ed3d4f 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -1459,7 +1459,7 @@ package body Exp_Aggr is and then not Is_Build_In_Place_Function_Call (Init_Expr) and then not (Is_Array_Type (Comp_Typ) - and then Is_Controlled (Component_Type (Comp_Typ)) + and then Needs_Finalization (Component_Type (Comp_Typ)) and then Nkind (Expr) = N_Aggregate) then Adj_Call := -- 2.47.2