diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2021-09-27 16:15:39 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-10-11 13:38:09 +0000 |
commit | 07118f4832ab8a2eaa1cb564cf8d852a3c4b175c (patch) | |
tree | 21aae44816f544ab7c7de4b4e226a3489ed27fa7 /gcc/ada | |
parent | 3e10307b9a76b0ba4a7b1f65518c015df6bf9e90 (diff) | |
download | gcc-07118f4832ab8a2eaa1cb564cf8d852a3c4b175c.zip gcc-07118f4832ab8a2eaa1cb564cf8d852a3c4b175c.tar.gz gcc-07118f4832ab8a2eaa1cb564cf8d852a3c4b175c.tar.bz2 |
[Ada] Fix crash on array component with Default_Value
gcc/ada/
* exp_util.adb (Inside_Init_Proc): Simplify.
* sem_aggr.adb (Resolve_Record_Aggregate): Fix style.
* sem_util.adb (Compile_Time_Constraint_Error): Guard against
calling Corresponding_Concurrent_Type with an array type entity.
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/exp_util.adb | 4 | ||||
-rw-r--r-- | gcc/ada/sem_aggr.adb | 4 | ||||
-rw-r--r-- | gcc/ada/sem_util.adb | 13 |
3 files changed, 12 insertions, 9 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index cb18096..11499e1 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -7994,10 +7994,8 @@ package body Exp_Util is ---------------------- function Inside_Init_Proc return Boolean is - Proc : constant Entity_Id := Enclosing_Init_Proc; - begin - return Proc /= Empty; + return Present (Enclosing_Init_Proc); end Inside_Init_Proc; ---------------------- diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 9ae5ff6..b51a3d0 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -5307,8 +5307,8 @@ package body Sem_Aggr is Add_Association (Component => Component, - Expr => Empty, - Assoc_List => New_Assoc_List, + Expr => Empty, + Assoc_List => New_Assoc_List, Is_Box_Present => True); elsif Present (Parent (Component)) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index b5f3d4c..20e4395 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -6589,11 +6589,16 @@ package body Sem_Util is if Inside_Init_Proc then declare + Init_Proc_Type : constant Entity_Id := + Entity (Parameter_Type (First + (Parameter_Specifications + (Parent (Current_Scope_No_Loops))))); + Conc_Typ : constant Entity_Id := - Corresponding_Concurrent_Type - (Entity (Parameter_Type (First - (Parameter_Specifications - (Parent (Current_Scope)))))); + (if Present (Init_Proc_Type) + and then Init_Proc_Type in E_Record_Type_Id + then Corresponding_Concurrent_Type (Init_Proc_Type) + else Empty); begin -- Don't complain if the corresponding concurrent type |