From: Piotr Trojanek Date: Thu, 16 Apr 2020 11:59:53 +0000 (+0200) Subject: [Ada] Fix failed assertion on a slice indexed by a subtype_indication X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a9fb2055f3a7a05e493bbb614aca5ed3a19b80d2;p=gcc.git [Ada] Fix failed assertion on a slice indexed by a subtype_indication 2020-06-18 Piotr Trojanek gcc/ada/ * checks.adb (Generate_Index_Checks): Handle N_Subtype_Indication returned from Scalar_Range. --- diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 51b73f992a6..7b8ca979a7e 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -6842,6 +6842,10 @@ package body Checks is elsif Nkind_In (A_Idx, N_Identifier, N_Expanded_Name) then A_Range := Scalar_Range (Entity (A_Idx)); + if Nkind (A_Range) = N_Subtype_Indication then + A_Range := Range_Expression (Constraint (A_Range)); + end if; + else pragma Assert (Nkind (A_Idx) = N_Subtype_Indication); A_Range := Range_Expression (Constraint (A_Idx)); end if;