aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch11.adb
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2008-03-26 08:42:03 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2008-03-26 08:42:03 +0100
commitd9f86c0c6cab087228394773d7b528c63e0a9969 (patch)
tree49ed46af481edd7d719287b170dade2b946c4501 /gcc/ada/sem_ch11.adb
parent9b91e15091b8d490e742ec04d8f1813c27f9cc13 (diff)
downloadgcc-d9f86c0c6cab087228394773d7b528c63e0a9969.zip
gcc-d9f86c0c6cab087228394773d7b528c63e0a9969.tar.gz
gcc-d9f86c0c6cab087228394773d7b528c63e0a9969.tar.bz2
sem_ch11.adb: Fix No_Exception_Restriction violation for SJLJ
2008-03-26 Robert Dewar <dewar@adacore.com> * sem_ch11.adb: Fix No_Exception_Restriction violation for SJLJ * sinfo.ads, sinfo.adb (From_At_End): New flag From-SVN: r133576
Diffstat (limited to 'gcc/ada/sem_ch11.adb')
-rw-r--r--gcc/ada/sem_ch11.adb24
1 files changed, 14 insertions, 10 deletions
diff --git a/gcc/ada/sem_ch11.adb b/gcc/ada/sem_ch11.adb
index 66cfc88..2be7470 100644
--- a/gcc/ada/sem_ch11.adb
+++ b/gcc/ada/sem_ch11.adb
@@ -437,7 +437,6 @@ package body Sem_Ch11 is
Exception_Id : constant Node_Id := Name (N);
Exception_Name : Entity_Id := Empty;
P : Node_Id;
- Nkind_P : Node_Kind;
begin
Check_Unreachable_Code (N);
@@ -484,16 +483,13 @@ package body Sem_Ch11 is
if No (Exception_Id) then
P := Parent (N);
- Nkind_P := Nkind (P);
-
- while Nkind_P /= N_Exception_Handler
- and then Nkind_P /= N_Subprogram_Body
- and then Nkind_P /= N_Package_Body
- and then Nkind_P /= N_Task_Body
- and then Nkind_P /= N_Entry_Body
+ while not Nkind_In (P, N_Exception_Handler,
+ N_Subprogram_Body,
+ N_Package_Body,
+ N_Task_Body,
+ N_Entry_Body)
loop
P := Parent (P);
- Nkind_P := Nkind (P);
end loop;
if Nkind (P) /= N_Exception_Handler then
@@ -506,7 +502,15 @@ package body Sem_Ch11 is
else
Set_Local_Raise_Not_OK (P);
- Check_Restriction (No_Exception_Propagation, N);
+
+ -- Do not check the restriction if the reraise statement is part
+ -- of the code generated for an AT-END handler. That's because
+ -- if the restriction is actually active, we never generate this
+ -- raise anyway, so the apparent violation is bogus.
+
+ if not From_At_End (N) then
+ Check_Restriction (No_Exception_Propagation, N);
+ end if;
end if;
-- Normal case with exception id present