aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2021-02-14 15:27:12 -0500
committerPierre-Marie de Rodat <derodat@adacore.com>2021-06-15 06:19:36 -0400
commit40f464256cb547f8663f44965d7bb8a68527be6b (patch)
tree2bc0fa76a802b1966fa21c41286a12dd41169572 /gcc
parent811b8aa53649982c352a1d56626e2a5b0b5d2696 (diff)
downloadgcc-40f464256cb547f8663f44965d7bb8a68527be6b.zip
gcc-40f464256cb547f8663f44965d7bb8a68527be6b.tar.gz
gcc-40f464256cb547f8663f44965d7bb8a68527be6b.tar.bz2
[Ada] Incorrect Reinit_Field_To_Zero calls for concurrent entities
gcc/ada/ * sem_ch3.adb (Make_Class_Wide_Type): Make sure all the calls to Reinit_Field_To_Zero are for the correct Ekinds.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_ch3.adb11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 11c6fdb..03280e5 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -19239,14 +19239,17 @@ package body Sem_Ch3 is
Reinit_Field_To_Zero (CW_Type, Private_Dependents);
elsif Ekind (CW_Type) in Concurrent_Kind then
- if Ekind (CW_Type) = E_Task_Type then
+ Reinit_Field_To_Zero (CW_Type, First_Private_Entity);
+ Reinit_Field_To_Zero (CW_Type, Scope_Depth_Value);
+
+ if Ekind (CW_Type) in Task_Kind then
Reinit_Field_To_Zero (CW_Type, Is_Elaboration_Checks_OK_Id);
Reinit_Field_To_Zero (CW_Type, Is_Elaboration_Warnings_OK_Id);
end if;
- Reinit_Field_To_Zero (CW_Type, First_Private_Entity);
- Reinit_Field_To_Zero (CW_Type, Scope_Depth_Value);
- Reinit_Field_To_Zero (CW_Type, SPARK_Aux_Pragma_Inherited);
+ if Ekind (CW_Type) in E_Task_Type | E_Protected_Type then
+ Reinit_Field_To_Zero (CW_Type, SPARK_Aux_Pragma_Inherited);
+ end if;
end if;
Mutate_Ekind (CW_Type, E_Class_Wide_Type);