Fix crash on ACATS test
B38003B introduced by a recent cleanup of
per-object constraints.
gcc/ada/
* sem_util.adb (Get_Index_Bounds): Guard against missing Entity,
which happens on illegal constrained type declaration.
H := High_Bound (Range_Expression (Constraint (N)));
end if;
- elsif Is_Entity_Name (N) and then Is_Type (Entity (N)) then
+ elsif Is_Entity_Name (N)
+ and then Present (Entity (N))
+ and then Is_Type (Entity (N))
+ then
Rng := Scalar_Range_Of_Type (Entity (N));
if Error_Posted (Rng) then