aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEd Schonberg <schonber@gnat.com>2001-12-03 19:06:53 +0000
committerGeert Bosch <bosch@gcc.gnu.org>2001-12-03 20:06:53 +0100
commit13f08f0368c33c9379540e9a1ca82f3570c86ff3 (patch)
treeea37520a774e34b33e5ce281203a3ce42a4f650c /gcc
parent3bd6c100304455a0240ca776b5c9cd683a0b7ad8 (diff)
downloadgcc-13f08f0368c33c9379540e9a1ca82f3570c86ff3.zip
gcc-13f08f0368c33c9379540e9a1ca82f3570c86ff3.tar.gz
gcc-13f08f0368c33c9379540e9a1ca82f3570c86ff3.tar.bz2
sem_ch12.adb (Instantiate_Package_Body): Protect against double instantiation of a body that contains an inlined body.
* sem_ch12.adb (Instantiate_Package_Body): Protect against double instantiation of a body that contains an inlined body. From-SVN: r47556
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/sem_ch12.adb8
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index d3acabe..f28fac2 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,10 @@
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:
(Analyze_generic_subprogram_Declaration): Set outer_generic_scope,
to prevent freezing within formal packages.
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 20af910..811644d 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -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