From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2100) id D9E32393C85A; Sat, 22 Aug 2020 23:21:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9E32393C85A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1598138492; bh=9RQyTdmT0qDPdyRo/5v18w0Qqiq3AgMkBG8pQICmUkk=; h=From:To:Subject:Date:From; b=suB+Zl6WDpHSva+panKkFFTkzUcuTU6od60pxf5pSwph2W2lZdLBHpulFxocrCSqQ CvO/abfj4oNECd6o9e74J5K3cXJ/w4fPahHEYdM3vgffsHraCdCTZIPy9yj9ztZxzN F5e6Lg/Vh8h0qqAYl4lE2rPW1HcBRXOAnXqH5bE4= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Giuliano Belinassi To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/autopar_devel] [Ada] Ada2020: AI12-0198 potentially unevaluated components of arrays X-Act-Checkin: gcc X-Git-Author: Javier Miranda X-Git-Refname: refs/heads/devel/autopar_devel X-Git-Oldrev: bb06a4318c07aa012e9d84140f6de84fb97d4008 X-Git-Newrev: fb27171675b2b3f9f6da53f69808aeb2f837af52 Message-Id: <20200822232132.D9E32393C85A@sourceware.org> Date: Sat, 22 Aug 2020 23:21:32 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Aug 2020 23:21:33 -0000 https://gcc.gnu.org/g:fb27171675b2b3f9f6da53f69808aeb2f837af52 commit fb27171675b2b3f9f6da53f69808aeb2f837af52 Author: Javier Miranda Date: Tue May 12 11:01:16 2020 -0400 [Ada] Ada2020: AI12-0198 potentially unevaluated components of arrays gcc/ada/ * sem_util.adb (Is_Potentially_Unevaluated): Protect reading attribute Etype. Diff: --- gcc/ada/sem_util.adb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 9383c5f6d0d..d0bde3344f8 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -17805,6 +17805,8 @@ package body Sem_Util is N_Or_Else, N_Quantified_Expression) and then not (Nkind (Par) = N_Aggregate + and then Present (Etype (Par)) + and then Etype (Par) /= Any_Composite and then Is_Array_Type (Etype (Par))) loop Expr := Par; @@ -17871,6 +17873,7 @@ package body Sem_Util is return True; elsif Nkind (Choice) = N_Identifier + and then Present (Etype (Choice)) and then Present (Scalar_Range (Etype (Choice))) and then Non_Static_Or_Null_Range (Scalar_Range (Etype (Choice)))