diff options
author | Robert Dewar <dewar@gnat.com> | 2001-12-05 02:45:14 +0000 |
---|---|---|
committer | Geert Bosch <bosch@gcc.gnu.org> | 2001-12-05 03:45:14 +0100 |
commit | 053defdfcda67fa5d33fd1721fe95fc6b5a95e82 (patch) | |
tree | f32e657c862cf3a3e3828ea7af82e7463fdaa54e | |
parent | f311e16612262241a694f1c260cea65405e30efe (diff) | |
download | gcc-053defdfcda67fa5d33fd1721fe95fc6b5a95e82.zip gcc-053defdfcda67fa5d33fd1721fe95fc6b5a95e82.tar.gz gcc-053defdfcda67fa5d33fd1721fe95fc6b5a95e82.tar.bz2 |
errout.adb (Error_Msg): Ignore attempt to put error msg at junk location if we already have errors.
* errout.adb (Error_Msg): Ignore attempt to put error msg at junk
location if we already have errors. Stops some cases of cascaded
errors.
* errout.adb: Improve comment.
From-SVN: r47653
-rw-r--r-- | gcc/ada/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/ada/errout.adb | 26 |
2 files changed, 26 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 3153721..6e607f2 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,13 @@ 2001-12-04 Robert Dewar <dewar@gnat.com> + * errout.adb (Error_Msg): Ignore attempt to put error msg at junk + location if we already have errors. Stops some cases of cascaded + errors. + + * errout.adb: Improve comment. + +2001-12-04 Robert Dewar <dewar@gnat.com> + * sem_ch12.adb: (Analyze_Formal_Type_Definition): Defend against Error. (Analyze_Formal_Subprogram): Defend against Error. diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index 74fc821..d78858c 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -665,15 +665,26 @@ package body Errout is -- additional messages referencing the generic declaration. procedure Error_Msg (Msg : String; Flag_Location : Source_Ptr) is - - Sindex : constant Source_File_Index := - Get_Source_File_Index (Flag_Location); + Sindex : Source_File_Index; + -- Source index for flag location Orig_Loc : Source_Ptr; -- Original location of Flag_Location (i.e. location in original -- template in instantiation case, otherwise unchanged). begin + -- If we already have messages, and we are trying to place a message + -- at No_Location or in package Standard, then just ignore the attempt + -- since we assume that what is happening is some cascaded junk. Note + -- that this is safe in the sense that proceeding will surely bomb. + + if Flag_Location < First_Source_Ptr + and then Errors_Detected > 0 + then + return; + end if; + + Sindex := Get_Source_File_Index (Flag_Location); Test_Warning_Msg (Msg); -- It is a fatal error to issue an error message when scanning from @@ -3069,11 +3080,10 @@ package body Errout is Ent := Etype (Ent); end if; - -- If we are stuck in a loop, get out and settle for the - -- internal name after all. In this case we set to kill the - -- message if it is not the first error message (we really try - -- hard not to show the dirty laundry of the implementation to - -- the poor user!) + -- If we are stuck in a loop, get out and settle for the internal + -- name after all. In this case we set to kill the message if it + -- is not the first error message (we really try hard not to show + -- the dirty laundry of the implementation to the poor user!) if Ent = Old_Ent then Kill_Message := True; |