diff options
author | Richard Henderson <rth@redhat.com> | 2001-10-08 10:09:23 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2001-10-08 10:09:23 -0700 |
commit | 295ef2bba9e066657bfb2153dd24dbab5d24d2e8 (patch) | |
tree | 8c2960c118c02a29b21e6b6ef25b1ee37a3683b0 | |
parent | 1f1b0541159f25e7d98b1b6b524983aa5de0c329 (diff) | |
download | gcc-295ef2bba9e066657bfb2153dd24dbab5d24d2e8.zip gcc-295ef2bba9e066657bfb2153dd24dbab5d24d2e8.tar.gz gcc-295ef2bba9e066657bfb2153dd24dbab5d24d2e8.tar.bz2 |
comperr.adb (Abort_In_Progress): New.
* comperr.adb (Abort_In_Progress): New.
(Compiler_Abort): Use it to prevent recursion.
From-SVN: r46082
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/comperr.adb | 18 |
2 files changed, 22 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 8801866..c7138f7 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2001-10-08 Richard Henderson <rth@redhat.com> + + * comperr.adb (Abort_In_Progress): New. + (Compiler_Abort): Use it to prevent recursion. + 2001-10-08 Robert Dewar <dewar@gnat.com> * atree.adb: Set Error_Posted in Error node, helps error recovery. diff --git a/gcc/ada/comperr.adb b/gcc/ada/comperr.adb index e92e0c4..b3d868f 100644 --- a/gcc/ada/comperr.adb +++ b/gcc/ada/comperr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- $Revision: 1.57 $ +-- $Revision: 1.1 $ -- -- -- Copyright (C) 1992-2001 Free Software Foundation, Inc. -- -- -- @@ -51,6 +51,14 @@ with System.Soft_Links; use System.Soft_Links; package body Comperr is + ---------------- + -- Local Data -- + ---------------- + + Abort_In_Progress : Boolean := False; + -- Used to prevent runaway recursion if something segfaults + -- while processing a previous abort. + ----------------------- -- Local Subprograms -- ----------------------- @@ -82,6 +90,14 @@ package body Comperr is -- Start of processing for Compiler_Abort begin + -- Prevent recursion through Compiler_Abort, e.g. via SIGSEGV. + + if Abort_In_Progress then + Exit_Program (E_Abort); + end if; + + Abort_In_Progress := True; + -- If errors have already occured, then we guess that the abort may -- well be caused by previous errors, and we don't make too much fuss -- about it, since we want to let the programmer fix the errors first. |