sem_ch12.adb (Instantiate_Package_Body): Protect against double instantiation of...
authorEd Schonberg <schonber@gnat.com>
Mon, 3 Dec 2001 19:06:53 +0000 (19:06 +0000)
committerGeert Bosch <bosch@gcc.gnu.org>
Mon, 3 Dec 2001 19:06:53 +0000 (20:06 +0100)
* sem_ch12.adb (Instantiate_Package_Body): Protect against double
instantiation of a body that contains an inlined body.

From-SVN: r47556

gcc/ada/ChangeLog
gcc/ada/sem_ch12.adb

index d3acabecc2939910cc9b08c4e13682dcb934aeac..f28fac2f21bdcde52049fc631b1089dfbb024812 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-03  Ed Schonberg <schonber@gnat.com>
+
+       * sem_ch12.adb (Instantiate_Package_Body): Protect against double 
+       instantiation of a body that contains an inlined body.
+
 2001-12-03  Ed Schonberg <schonber@gnat.com>
 
        * sem_ch12.adb:
index 20af910b814c4842802e2dae42523e64f0bdf7bc..811644d2d3c044315e74ff65b253fd61cf271cd8 100644 (file)
@@ -6503,6 +6503,14 @@ package body Sem_Ch12 is
 
    begin
       Gen_Body_Id := Corresponding_Body (Gen_Decl);
+
+      --  The instance body may already have been processed, as the parent
+      --  of another instance that is inlined. (Load_Parent_Of_Generic).
+
+      if Present (Corresponding_Body (Instance_Spec (Inst_Node))) then
+         return;
+      end if;
+
       Expander_Mode_Save_And_Set (Body_Info.Expander_Status);
 
       if No (Gen_Body_Id) then