From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id BAB3F3856974; Thu, 14 Sep 2023 12:45:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BAB3F3856974 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694695519; bh=/U9GB1ZV5XP17sOUd7uQAHCtAA0sn+xoBNhFPevHyM4=; h=From:To:Subject:Date:From; b=M/v3wJAuHVFjannpN2iNHQLM2AdW9eAZwAzXJqvnEHL5Qjgve2rRZ6uRwJiT1DIu5 +tXhkU5yRXqvVPFmqTOrBPf2eBp6aiESmUxoEp1Lkl0ulFzg2nXedkBLkpIxUoNman 1C9udefoQBCWTjbDIqjKS+Vdx+1Qyj4St382+AwY= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-3986] ada: Assertion failure on for-of loop iterating on selected component X-Act-Checkin: gcc X-Git-Author: Javier Miranda X-Git-Refname: refs/heads/master X-Git-Oldrev: f8f05af400c99cdbdccfc57d536ccf5e1f0bdc47 X-Git-Newrev: 1f68777549eb0104267bebaa1b94d173e1656d01 Message-Id: <20230914124519.BAB3F3856974@sourceware.org> Date: Thu, 14 Sep 2023 12:45:19 +0000 (GMT) List-Id: https://gcc.gnu.org/g:1f68777549eb0104267bebaa1b94d173e1656d01 commit r14-3986-g1f68777549eb0104267bebaa1b94d173e1656d01 Author: Javier Miranda Date: Mon Aug 28 18:32:18 2023 +0000 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: --- gcc/ada/sem_util.adb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 35ec296ab93..3229f4e9dd2 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;