diff options
author | Arnaud Charlet <charlet@adacore.com> | 2010-06-23 09:29:04 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-06-23 11:29:04 +0200 |
commit | b941ae6528c7f24d93a6f819ad2507727f3bd3ed (patch) | |
tree | ee7b310d3d69c3217d929c87f613939e51ddaa69 /gcc | |
parent | 87dc09cbb83422854550aa1f33dd7ac430351300 (diff) | |
download | gcc-b941ae6528c7f24d93a6f819ad2507727f3bd3ed.zip gcc-b941ae6528c7f24d93a6f819ad2507727f3bd3ed.tar.gz gcc-b941ae6528c7f24d93a6f819ad2507727f3bd3ed.tar.bz2 |
exp_ch4.adb (Expand_N_Allocator): Fix potential crash when using No_Task_Hierarchy restriction.
2010-06-23 Arnaud Charlet <charlet@adacore.com>
* exp_ch4.adb (Expand_N_Allocator): Fix potential crash when using
No_Task_Hierarchy restriction. Add comment.
* exp_ch9.adb, exp_ch3.adb: Update comments.
From-SVN: r161266
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ada/exp_ch3.adb | 7 | ||||
-rw-r--r-- | gcc/ada/exp_ch4.adb | 11 | ||||
-rw-r--r-- | gcc/ada/exp_ch9.adb | 5 |
4 files changed, 17 insertions, 12 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 00e199b..5af1505 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2010-06-23 Arnaud Charlet <charlet@adacore.com> + + * exp_ch4.adb (Expand_N_Allocator): Fix potential crash when using + No_Task_Hierarchy restriction. Add comment. + * exp_ch9.adb, exp_ch3.adb: Update comments. + 2010-06-23 Robert Dewar <dewar@adacore.com> * sem_ch5.adb (Process_Bounds): Remove some junk initializations. diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 9326406..e2263f3 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -1465,8 +1465,8 @@ package body Exp_Ch3 is if Has_Task (Full_Type) then if Restriction_Active (No_Task_Hierarchy) then - -- See comments in System.Tasking.Initialization.Init_RTS - -- for the value 3 (should be rtsfindable constant ???) + -- 3 is System.Tasking.Library_Task_Level + -- (should be rtsfindable constant ???) Append_To (Args, Make_Integer_Literal (Loc, 3)); @@ -2020,8 +2020,7 @@ package body Exp_Ch3 is if Has_Task (Rec_Type) then if Restriction_Active (No_Task_Hierarchy) then - -- See comments in System.Tasking.Initialization.Init_RTS - -- for the value 3. + -- 3 is System.Tasking.Library_Task_Level Append_To (Args, Make_Integer_Literal (Loc, 3)); else diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 5cbcc39..7588ae3 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -3644,9 +3644,11 @@ package body Exp_Ch4 is -- The designated type was an incomplete type, and the -- access type did not get expanded. Salvage it now. - pragma Assert (Present (Parent (Base_Type (PtrT)))); - Expand_N_Full_Type_Declaration - (Parent (Base_Type (PtrT))); + if not Restriction_Active (No_Task_Hierarchy) then + pragma Assert (Present (Parent (Base_Type (PtrT)))); + Expand_N_Full_Type_Declaration + (Parent (Base_Type (PtrT))); + end if; end if; -- If the context of the allocator is a declaration or an @@ -3689,9 +3691,8 @@ package body Exp_Ch4 is Decls := Build_Task_Image_Decls (Loc, T, T); end if; - -- What is this constant 3 below, should have a name ??? - if Restriction_Active (No_Task_Hierarchy) then + -- 3 is System.Tasking.Library_Task_Level Append_To (Args, Make_Integer_Literal (Loc, 3)); else Append_To (Args, diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 70d9226..2aec546 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -12121,9 +12121,8 @@ package body Exp_Ch9 is -- Master parameter. This is a reference to the _Master parameter of -- the initialization procedure, except in the case of the pragma - -- Restrictions (No_Task_Hierarchy) where the value is fixed to 3. - -- See comments in System.Tasking.Initialization.Init_RTS for the - -- value 3. + -- Restrictions (No_Task_Hierarchy) where the value is fixed to 3 + -- (3 is System.Tasking.Library_Task_Level). if Restriction_Active (No_Task_Hierarchy) = False then Append_To (Args, Make_Identifier (Loc, Name_uMaster)); |