Commit 9c723dcb by Javier Miranda Committed by Arnaud Charlet

par-endh.adb (Explicit_Start_Label): Add code to protect the parser against…

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
parent 4f73f89c
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -759,12 +759,22 @@ package body Endh is ...@@ -759,12 +759,22 @@ package body Endh is
-------------------------- --------------------------
function Explicit_Start_Label (SS_Index : Nat) return Boolean 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 begin
if No (L) then if No (L) then
return False; 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; return True;
else else
return False; return False;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment