From: Eric Botcazou Date: Tue, 4 Apr 2023 22:03:27 +0000 (+0200) Subject: ada: Fix memory leak in multi-dimensional array aggregate of Vector X-Git-Tag: basepoints/gcc-15~8801 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ad28c8ff6a78082eaa836c2d475ffb6b0b6f08b;p=thirdparty%2Fgcc.git 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. --- 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 :=