From: Yannick Moy Date: Fri, 23 Jul 2021 08:52:51 +0000 (+0200) Subject: [Ada] Add adequate guard before calling First_Rep_Item X-Git-Tag: basepoints/gcc-13~4501 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f325f5e6fd091f73f5be6ef30d27e22e4b59a74;p=thirdparty%2Fgcc.git [Ada] Add adequate guard before calling First_Rep_Item gcc/ada/ * sem_ch13.adb (Build_Predicate_Functions): Add guard. --- diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 8bc849029820..595a741346f3 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -10104,7 +10104,10 @@ package body Sem_Ch13 is -- If the type is private, check whether full view has inherited -- predicates. - if Is_Private_Type (Typ) and then No (Ritem) then + if Is_Private_Type (Typ) + and then No (Ritem) + and then Present (Full_View (Typ)) + then Ritem := First_Rep_Item (Full_View (Typ)); end if;