From: Javier Miranda Date: Mon, 28 Aug 2023 18:32:18 +0000 (+0000) Subject: ada: Assertion failure on for-of loop iterating on selected component X-Git-Tag: basepoints/gcc-15~6153 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f68777549eb0104267bebaa1b94d173e1656d01;p=thirdparty%2Fgcc.git ada: Assertion failure on for-of loop iterating on selected component gcc/ada/ * sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Protect access to Entity attribute and add missing code to check function selector in a prefix form call. --- diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 35ec296ab932..3229f4e9dd2b 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -16509,8 +16509,13 @@ package body Sem_Util is -- False (it could be a function selector in a prefix form call -- occurring in an iterator specification). - if Ekind (Entity (Selector_Name (Object))) not in - E_Component | E_Discriminant + if (Present (Entity (Selector_Name (Object))) + and then Ekind (Entity (Selector_Name (Object))) not in + E_Component | E_Discriminant) + or else + (Inside_A_Generic + and then Nkind (Parent (Selector_Name (Object))) + = N_Function_Call) then return False; end if;