aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch6.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
-rw-r--r--gcc/ada/sem_ch6.adb19
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 85edfab..4d766b9 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -7564,6 +7564,8 @@ package body Sem_Ch6 is
Err : out Boolean;
Proc : Entity_Id := Empty)
is
+ pragma Assert (Mode in 'F' | 'P');
+ pragma Assert (if Mode = 'F' then No (Proc));
Handler : Node_Id;
procedure Check_Statement_Sequence (L : List_Id);
@@ -7613,15 +7615,13 @@ package body Sem_Ch6 is
-- Local variables
- Raise_Exception_Call : Boolean;
+ Raise_Exception_Call : Boolean := False;
-- Set True if statement sequence terminated by Raise_Exception call
-- or a Reraise_Occurrence call.
-- Start of processing for Check_Statement_Sequence
begin
- Raise_Exception_Call := False;
-
-- Get last real statement
Last_Stm := Last (L);
@@ -7687,7 +7687,8 @@ package body Sem_Ch6 is
while Nkind (Last_Stm) = N_Pragma
- -- Don't count call to SS_Release (can happen after Raise_Exception)
+ -- Don't count call to SS_Release (can happen after
+ -- Raise_Exception).
or else
(Nkind (Last_Stm) = N_Procedure_Call_Statement
@@ -7696,7 +7697,7 @@ package body Sem_Ch6 is
and then
Is_RTE (Entity (Name (Last_Stm)), RE_SS_Release))
- -- Don't count exception junk
+ -- Don't count exception junk
or else
(Nkind (Last_Stm) in
@@ -7704,10 +7705,12 @@ package body Sem_Ch6 is
and then Exception_Junk (Last_Stm))
or else Nkind (Last_Stm) in N_Push_xxx_Label | N_Pop_xxx_Label
- -- Inserted code, such as finalization calls, is irrelevant: we only
- -- need to check original source.
+ -- Inserted code, such as finalization calls, is irrelevant; we
+ -- only need to check original source. If we see a transfer of
+ -- control, we stop.
- or else Is_Rewrite_Insertion (Last_Stm)
+ or else (Is_Rewrite_Insertion (Last_Stm)
+ and then not Is_Transfer (Last_Stm))
loop
Prev (Last_Stm);
end loop;