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-2153] [Ada] Prevent infinite recursion when there is no expected unit
Date: Thu,  8 Jul 2021 13:36:59 +0000 (GMT)	[thread overview]
Message-ID: <20210708133659.BCD08398B881@sourceware.org> (raw)

https://gcc.gnu.org/g:62aae315f680f2205d474ff3ebcb1756a707f715

commit r12-2153-g62aae315f680f2205d474ff3ebcb1756a707f715
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Wed May 26 15:05:28 2021 +0200

    [Ada] Prevent infinite recursion when there is no expected unit
    
    gcc/ada/
    
            * par-load.adb (Load): Don't remove unit, but flag it as
            erroneous and return.

Diff:
---
 gcc/ada/par-load.adb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/par-load.adb b/gcc/ada/par-load.adb
index 0773f36946f..6079fa477f6 100644
--- a/gcc/ada/par-load.adb
+++ b/gcc/ada/par-load.adb
@@ -234,9 +234,10 @@ begin
          Error_Msg ("\\found unit $!", Loc);
       end if;
 
-      --  In both cases, remove the unit so that it is out of the way later
+      --  In both cases, flag the fatal error and give up
 
-      Remove_Unit (Cur_Unum);
+      Set_Fatal_Error (Cur_Unum, Error_Detected);
+      return;
    end if;
 
    --  If current unit is a body, load its corresponding spec


                 reply	other threads:[~2021-07-08 13:36 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=20210708133659.BCD08398B881@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).