[COMMITTED] ada: Fix memory leak in multi-dimensional array aggregate of Vector
Commit Message
From: Eric Botcazou <ebotcazou@adacore.com>
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.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/exp_aggr.adb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -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 :=