[Ada] Add adequate guard before calling First_Rep_Item

gcc/ada/

	* sem_ch13.adb (Build_Predicate_Functions): Add guard.
This commit is contained in:
Yannick Moy 2021-07-23 10:52:51 +02:00 committed by Pierre-Marie de Rodat
parent 27534649ab
commit 5f325f5e6f

View File

@ -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;