diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-06-14 14:46:56 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-06-14 14:46:56 +0200 |
commit | ee81cbe97718536484b0b623ff875d4a3fabbce0 (patch) | |
tree | 4ff6cbab8713c7b9893c800893dc57cb255b68fc /gcc/ada/sem_res.adb | |
parent | a40520ecc5ef565405dc8a3dcd9f5070c5dea5d3 (diff) | |
download | gcc-ee81cbe97718536484b0b623ff875d4a3fabbce0.zip gcc-ee81cbe97718536484b0b623ff875d4a3fabbce0.tar.gz gcc-ee81cbe97718536484b0b623ff875d4a3fabbce0.tar.bz2 |
[multiple changes]
2010-06-14 Pascal Obry <obry@adacore.com>
* s-finimp.adb: Fix typo.
* raise.h: Remove duplicate blank line.
2010-06-14 Vincent Celier <celier@adacore.com>
* prj-nmsc.adb (Add_Sources): Always set the object file and the
switches file names, as the configuration of the language may change
in an extending project.
(Process_Naming_Scheme): For sources of projects that are extended, set
the configuration of the language from the highest extending project
where the language is declared.
2010-06-14 Gary Dismukes <dismukes@adacore.com>
* sem_res.adb (Resolve_Call): For infinite recursion check, test
whether the called subprogram is inherited from a containing subprogram.
(Same_Or_Aliased_Subprograms): New function
From-SVN: r160733
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r-- | gcc/ada/sem_res.adb | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 9a0a0ac..14c0210 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -4763,6 +4763,25 @@ package body Sem_Res is Scop : Entity_Id; Rtype : Entity_Id; + function Same_Or_Aliased_Subprograms + (S : Entity_Id; + E : Entity_Id) return Boolean; + -- Returns True if the subprogram entity S is the same as E or else + -- S is an alias of E. + + function Same_Or_Aliased_Subprograms + (S : Entity_Id; + E : Entity_Id) return Boolean + is + Subp_Alias : constant Entity_Id := Alias (S); + + begin + return S = E + or else (Present (Subp_Alias) and then Subp_Alias = E); + end Same_Or_Aliased_Subprograms; + + -- Start of processing for Resolve_Call + begin -- The context imposes a unique interpretation with type Typ on a -- procedure or function call. Find the entity of the subprogram that @@ -5095,7 +5114,7 @@ package body Sem_Res is -- Issue warning for possible infinite recursion in the absence -- of the No_Recursion restriction. - if Nam = Scop + if Same_Or_Aliased_Subprograms (Nam, Scop) and then not Restriction_Active (No_Recursion) and then Check_Infinite_Recursion (N) then @@ -5112,7 +5131,7 @@ package body Sem_Res is else Scope_Loop : while Scop /= Standard_Standard loop - if Nam = Scop then + if Same_Or_Aliased_Subprograms (Nam, Scop) then -- Although in general case, recursion is not statically -- checkable, the case of calling an immediately containing |