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 r13-1422] [Ada] Fix for resolution of overloaded subprogram for Iterable aspect Date: Mon, 4 Jul 2022 07:49:51 +0000 (GMT) [thread overview] Message-ID: <20220704074951.EA6FD385BAC0@sourceware.org> (raw) https://gcc.gnu.org/g:df69e326b39dabc34f0c9b31f694079e5fa1343a commit r13-1422-gdf69e326b39dabc34f0c9b31f694079e5fa1343a Author: Piotr Trojanek <trojanek@adacore.com> Date: Fri May 20 22:29:51 2022 +0200 [Ada] Fix for resolution of overloaded subprogram for Iterable aspect When resolving the Iterable aspect we look for a functions that are declared in the same scope as the annotated type and that have the required number and types formal parameters. However, we didn't guard against functions that have no formal parameter at all. gcc/ada/ * sem_ch13.adb (Resolve_Iterable_Operation): Add guard to prevent crash when the examined function has no formal parameters and Etype is called on Empty entity. Diff: --- gcc/ada/sem_ch13.adb | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 0b8911b8dcd..27f32504999 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -15943,6 +15943,7 @@ package body Sem_Ch13 is while Present (It.Typ) loop if Ekind (It.Nam) = E_Function and then Scope (It.Nam) = Scope (Typ) + and then Present (First_Formal (It.Nam)) and then Etype (First_Formal (It.Nam)) = Typ then F1 := First_Formal (It.Nam);
reply other threads:[~2022-07-04 7:49 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=20220704074951.EA6FD385BAC0@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: linkBe 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).