From: Justin Squirek Date: Sat, 30 Oct 2021 03:43:38 +0000 (-0400) Subject: [Ada] Hang on compilation of unit with type extension in body X-Git-Tag: basepoints/gcc-13~3275 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f24d32cf6ae542f779a309e4b2f6c77fb6af4f7;p=thirdparty%2Fgcc.git [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 --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index b0ea44a7f7b7..1bba0595741e 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