public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-4025] [Ada] Add missing guard before call to Interface_Present_In_Ancestor
Date: Fri,  1 Oct 2021 06:16:13 +0000 (GMT)	[thread overview]
Message-ID: <20211001061613.77B263857C52@sourceware.org> (raw)

https://gcc.gnu.org/g:3a81dbb618e3ac6cd42ac6f296a96296e099ac1f

commit r12-4025-g3a81dbb618e3ac6cd42ac6f296a96296e099ac1f
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Thu Aug 12 18:12:40 2021 +0200

    [Ada] Add missing guard before call to Interface_Present_In_Ancestor
    
    gcc/ada/
    
            * sem_type.adb (Specific_Type): Check that the type is tagged
            before calling Interface_Present_In_Ancestor on it.

Diff:
---
 gcc/ada/sem_type.adb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb
index 3ca2e302a8e..8e5b067bb76 100644
--- a/gcc/ada/sem_type.adb
+++ b/gcc/ada/sem_type.adb
@@ -3424,7 +3424,8 @@ package body Sem_Type is
       --  Ada 2005 (AI-251): T1 is a concrete type that implements the
       --  class-wide interface T2
 
-      elsif Is_Class_Wide_Type (T2)
+      elsif Is_Tagged_Type (T1)
+        and then Is_Class_Wide_Type (T2)
         and then Is_Interface (Etype (T2))
         and then Interface_Present_In_Ancestor (Typ   => T1,
                                                 Iface => Etype (T2))


                 reply	other threads:[~2021-10-01  6:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211001061613.77B263857C52@sourceware.org \
    --to=pmderodat@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).