Commit b941ae65 by Arnaud Charlet Committed by Arnaud Charlet

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
parent 87dc09cb
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> 2010-06-23 Robert Dewar <dewar@adacore.com>
* sem_ch5.adb (Process_Bounds): Remove some junk initializations. * sem_ch5.adb (Process_Bounds): Remove some junk initializations.
......
...@@ -1465,8 +1465,8 @@ package body Exp_Ch3 is ...@@ -1465,8 +1465,8 @@ package body Exp_Ch3 is
if Has_Task (Full_Type) then if Has_Task (Full_Type) then
if Restriction_Active (No_Task_Hierarchy) then if Restriction_Active (No_Task_Hierarchy) then
-- See comments in System.Tasking.Initialization.Init_RTS -- 3 is System.Tasking.Library_Task_Level
-- for the value 3 (should be rtsfindable constant ???) -- (should be rtsfindable constant ???)
Append_To (Args, Make_Integer_Literal (Loc, 3)); Append_To (Args, Make_Integer_Literal (Loc, 3));
...@@ -2020,8 +2020,7 @@ package body Exp_Ch3 is ...@@ -2020,8 +2020,7 @@ package body Exp_Ch3 is
if Has_Task (Rec_Type) then if Has_Task (Rec_Type) then
if Restriction_Active (No_Task_Hierarchy) then if Restriction_Active (No_Task_Hierarchy) then
-- See comments in System.Tasking.Initialization.Init_RTS -- 3 is System.Tasking.Library_Task_Level
-- for the value 3.
Append_To (Args, Make_Integer_Literal (Loc, 3)); Append_To (Args, Make_Integer_Literal (Loc, 3));
else else
......
...@@ -3644,10 +3644,12 @@ package body Exp_Ch4 is ...@@ -3644,10 +3644,12 @@ package body Exp_Ch4 is
-- The designated type was an incomplete type, and the -- The designated type was an incomplete type, and the
-- access type did not get expanded. Salvage it now. -- access type did not get expanded. Salvage it now.
if not Restriction_Active (No_Task_Hierarchy) then
pragma Assert (Present (Parent (Base_Type (PtrT)))); pragma Assert (Present (Parent (Base_Type (PtrT))));
Expand_N_Full_Type_Declaration Expand_N_Full_Type_Declaration
(Parent (Base_Type (PtrT))); (Parent (Base_Type (PtrT)));
end if; end if;
end if;
-- If the context of the allocator is a declaration or an -- If the context of the allocator is a declaration or an
-- assignment, we can generate a meaningful image for it, -- assignment, we can generate a meaningful image for it,
...@@ -3689,9 +3691,8 @@ package body Exp_Ch4 is ...@@ -3689,9 +3691,8 @@ package body Exp_Ch4 is
Decls := Build_Task_Image_Decls (Loc, T, T); Decls := Build_Task_Image_Decls (Loc, T, T);
end if; end if;
-- What is this constant 3 below, should have a name ???
if Restriction_Active (No_Task_Hierarchy) then if Restriction_Active (No_Task_Hierarchy) then
-- 3 is System.Tasking.Library_Task_Level
Append_To (Args, Make_Integer_Literal (Loc, 3)); Append_To (Args, Make_Integer_Literal (Loc, 3));
else else
Append_To (Args, Append_To (Args,
......
...@@ -12121,9 +12121,8 @@ package body Exp_Ch9 is ...@@ -12121,9 +12121,8 @@ package body Exp_Ch9 is
-- Master parameter. This is a reference to the _Master parameter of -- Master parameter. This is a reference to the _Master parameter of
-- the initialization procedure, except in the case of the pragma -- the initialization procedure, except in the case of the pragma
-- Restrictions (No_Task_Hierarchy) where the value is fixed to 3. -- Restrictions (No_Task_Hierarchy) where the value is fixed to 3
-- See comments in System.Tasking.Initialization.Init_RTS for the -- (3 is System.Tasking.Library_Task_Level).
-- value 3.
if Restriction_Active (No_Task_Hierarchy) = False then if Restriction_Active (No_Task_Hierarchy) = False then
Append_To (Args, Make_Identifier (Loc, Name_uMaster)); Append_To (Args, Make_Identifier (Loc, Name_uMaster));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment