diff options
author | Javier Miranda <miranda@adacore.com> | 2006-02-15 10:42:38 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2006-02-15 10:42:38 +0100 |
commit | 9c723dcb4d5f5e5223bcb8b1043179d231e4e08d (patch) | |
tree | fc48dcca2121209427424e5861a4431d0c55f78f /gcc/ada/par-endh.adb | |
parent | 4f73f89c47d52ef4575a3a553bdc1440959465db (diff) | |
download | gcc-9c723dcb4d5f5e5223bcb8b1043179d231e4e08d.zip gcc-9c723dcb4d5f5e5223bcb8b1043179d231e4e08d.tar.gz gcc-9c723dcb4d5f5e5223bcb8b1043179d231e4e08d.tar.bz2 |
par-endh.adb (Explicit_Start_Label): Add code to protect the parser against source containing syntax errors.
2006-02-13 Javier Miranda <miranda@adacore.com>
* par-endh.adb (Explicit_Start_Label): Add code to protect the parser
against source containing syntax errors.
From-SVN: r111082
Diffstat (limited to 'gcc/ada/par-endh.adb')
-rw-r--r-- | gcc/ada/par-endh.adb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gcc/ada/par-endh.adb b/gcc/ada/par-endh.adb index c58b0d2..4200889 100644 --- a/gcc/ada/par-endh.adb +++ b/gcc/ada/par-endh.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -759,12 +759,22 @@ package body Endh is -------------------------- function Explicit_Start_Label (SS_Index : Nat) return Boolean is - L : constant Node_Id := Scope.Table (SS_Index).Labl; + L : constant Node_Id := Scope.Table (SS_Index).Labl; + Etyp : constant SS_End_Type := Scope.Table (SS_Index).Etyp; begin if No (L) then return False; - elsif Comes_From_Source (L) then + + -- In the following test we protect the call to Comes_From_Source + -- against lines containing previously reported syntax errors. + + elsif (Etyp = E_Loop + or else Etyp = E_Name + or else Etyp = E_Suspicious_Is + or else Etyp = E_Bad_Is) + and then Comes_From_Source (L) + then return True; else return False; |