aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-04-05 00:03:27 +0200
committerMarc Poulhiès <poulhies@adacore.com>2023-05-29 10:23:20 +0200
commit5ad28c8ff6a78082eaa836c2d475ffb6b0b6f08b (patch)
tree6019f8067781d559d206e2bb357131033a5abcb3
parent9098ae6cde6f6ec9818c180f28a7a7f7ebc6699d (diff)
downloadgcc-5ad28c8ff6a78082eaa836c2d475ffb6b0b6f08b.zip
gcc-5ad28c8ff6a78082eaa836c2d475ffb6b0b6f08b.tar.gz
gcc-5ad28c8ff6a78082eaa836c2d475ffb6b0b6f08b.tar.bz2
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.
-rw-r--r--gcc/ada/exp_aggr.adb2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index 75e5e14..c4a016e 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 :=