exp_util.adb (Find_Interface_Tag): Reorder processing of incoming Typ argument to ensure proper management of...

2009-07-10  Javier Miranda  <miranda@adacore.com>

	* exp_util.adb (Find_Interface_Tag): Reorder processing of incoming
	Typ argument to ensure proper management of access types.

From-SVN: r149461
This commit is contained in:
Javier Miranda 2009-07-10 11:10:43 +02:00 committed by Arnaud Charlet
parent 9d9dacaa9e
commit c6ad817fc1

View File

@ -1600,6 +1600,18 @@ package body Exp_Util is
begin
pragma Assert (Is_Interface (Iface));
-- Handle access types
if Is_Access_Type (Typ) then
Typ := Directly_Designated_Type (Typ);
end if;
-- Handle class-wide types
if Is_Class_Wide_Type (Typ) then
Typ := Root_Type (Typ);
end if;
-- Handle private types
if Has_Private_Declaration (Typ)
@ -1608,10 +1620,11 @@ package body Exp_Util is
Typ := Full_View (Typ);
end if;
-- Handle access types
-- Handle entities from the limited view
if Is_Access_Type (Typ) then
Typ := Directly_Designated_Type (Typ);
if Ekind (Typ) = E_Incomplete_Type then
pragma Assert (Present (Non_Limited_View (Typ)));
Typ := Non_Limited_View (Typ);
end if;
-- Handle task and protected types implementing interfaces
@ -1620,17 +1633,6 @@ package body Exp_Util is
Typ := Corresponding_Record_Type (Typ);
end if;
if Is_Class_Wide_Type (Typ) then
Typ := Etype (Typ);
end if;
-- Handle entities from the limited view
if Ekind (Typ) = E_Incomplete_Type then
pragma Assert (Present (Non_Limited_View (Typ)));
Typ := Non_Limited_View (Typ);
end if;
Find_Tag (Typ);
pragma Assert (Found);
return AI_Tag;