public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2153] [Ada] Prevent infinite recursion when there is no expected unit
@ 2021-07-08 13:36 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-07-08 13:36 UTC (permalink / raw)
  To: gcc-cvs

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-08 13:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08 13:36 [gcc r12-2153] [Ada] Prevent infinite recursion when there is no expected unit Pierre-Marie de Rodat

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).