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>
* sem_ch5.adb (Process_Bounds): Remove some junk initializations.
......
......@@ -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
......
......@@ -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,
......
......@@ -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));
......
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