public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5038] [Ada] Hang on compilation of unit with type extension in body
@ 2021-11-09  9:47 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-11-09  9:47 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:9f24d32cf6ae542f779a309e4b2f6c77fb6af4f7

commit r12-5038-g9f24d32cf6ae542f779a309e4b2f6c77fb6af4f7
Author: Justin Squirek <squirek@adacore.com>
Date:   Fri Oct 29 23:43:38 2021 -0400

    [Ada] Hang on compilation of unit with type extension in body
    
    gcc/ada/
    
            * exp_util.adb (Ancestor_Primitive): Prevent return of an
            subprogram alias when the ancestor primitive of the alias is the
            same as Subp.

Diff:
---
 gcc/ada/exp_util.adb | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index b0ea44a7f7b..1bba0595741 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -10433,6 +10433,14 @@ package body Exp_Util is
          --  inherited ancestor primitive.
 
          elsif Present (Inher_Prim) then
+            --  It is possible that an internally generated alias could be
+            --  set to a subprogram which overrides the same aliased primitive,
+            --  so return Empty in this case.
+
+            if Ancestor_Primitive (Inher_Prim) = Subp then
+               return Empty;
+            end if;
+
             return Inher_Prim;
 
          --  Otherwise the current subprogram is the root of the inheritance or


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-09  9:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09  9:47 [gcc r12-5038] [Ada] Hang on compilation of unit with type extension in body Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).