https://gcc.gnu.org/g:8e76c189f10ee3b766cfde6b1ccb59b49342b0e5
commit r15-401-g8e76c189f10ee3b766cfde6b1ccb59b49342b0e5 Author: Piotr Trojanek <troja...@adacore.com> Date: Sun Jan 21 23:29:52 2024 +0100 ada: Avoid crash on illegal constrained type declarations 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. Diff: --- gcc/ada/sem_util.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 5f44b4c26fe5..579172515df4 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -10542,7 +10542,10 @@ package body Sem_Util is 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