+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.
-- --
-- B o d y --
-- --
--- $Revision: 1.57 $
+-- $Revision: 1.1 $
-- --
-- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
-- --
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 --
-----------------------
-- 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.