Commit 9450205a by Ed Schonberg Committed by Arnaud Charlet

exp_ch4.adb (Get_Allocator_Final_List): Freeze anonymous type for chain at once...

2008-08-04  Ed Schonberg  <schonberg@adacore.com>

	* exp_ch4.adb (Get_Allocator_Final_List): Freeze anonymous type for
	chain at once, to ensure that type is properly decorated for back-end,
	when allocator appears within a loop.

From-SVN: r138597
parent c18b3a99
...@@ -977,8 +977,7 @@ package body Exp_Ch4 is ...@@ -977,8 +977,7 @@ package body Exp_Ch4 is
-- not allow sliding, but this check does (a relaxation from Ada 83). -- not allow sliding, but this check does (a relaxation from Ada 83).
if Is_Constrained (DesigT) if Is_Constrained (DesigT)
and then not Subtypes_Statically_Match and then not Subtypes_Statically_Match (T, DesigT)
(T, DesigT)
then then
Apply_Constraint_Check Apply_Constraint_Check
(Exp, DesigT, No_Sliding => False); (Exp, DesigT, No_Sliding => False);
...@@ -8354,7 +8353,9 @@ package body Exp_Ch4 is ...@@ -8354,7 +8353,9 @@ package body Exp_Ch4 is
-- chain. The Final_Chain that is thus created is shared by the -- chain. The Final_Chain that is thus created is shared by the
-- access parameter. The access type is tested against the result -- access parameter. The access type is tested against the result
-- type of the function to exclude allocators whose type is an -- type of the function to exclude allocators whose type is an
-- anonymous access result type. -- anonymous access result type. We freeze the type at once to
-- ensure that it is properly decorated for the back-end, even
-- if the context and current scope is a loop.
if Nkind (Associated_Node_For_Itype (PtrT)) if Nkind (Associated_Node_For_Itype (PtrT))
in N_Subprogram_Specification in N_Subprogram_Specification
...@@ -8371,6 +8372,7 @@ package body Exp_Ch4 is ...@@ -8371,6 +8372,7 @@ package body Exp_Ch4 is
Subtype_Indication => Subtype_Indication =>
New_Occurrence_Of (T, Loc)))); New_Occurrence_Of (T, Loc))));
Freeze_Before (N, Owner);
Build_Final_List (N, Owner); Build_Final_List (N, Owner);
Set_Associated_Final_Chain (PtrT, Associated_Final_Chain (Owner)); Set_Associated_Final_Chain (PtrT, Associated_Final_Chain (Owner));
......
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