This is the mail archive of the
mailing list for the GCC project.
[Ada] Failure to detect trivial infinite recursion
- From: Pierre-Marie de Rodat <derodat at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Hristian Kirtchev <kirtchev at adacore dot com>
- Date: Fri, 5 Jul 2019 03:08:40 -0400
- Subject: [Ada] Failure to detect trivial infinite recursion
This patch includes delay statements in the set of control flow
statements since their expressions may have side effects, which in turn
may affect an infinite recursion.
Tested on x86_64-pc-linux-gnu, committed on trunk
2019-07-05 Hristian Kirtchev <email@example.com>
* sem_res.adb (Is_Control_Flow_Statement): Delay statements
contain an expression, which in turn may have side effects and
affect the infinite recursion. As a result, delay statements
should not be treated specially.
@@ -816,19 +816,11 @@ package body Sem_Res is
function Is_Control_Flow_Statement (N : Node_Id) return Boolean is
- -- Delay statements do not affect the control flow because they
- -- simply postpone the execution of all subsequent statements.
+ -- It is assumed that all statements may affect the control flow in
+ -- some way. A raise statement may be expanded into a non-statement
+ -- node.
- if Nkind (N) in N_Delay_Statement then
- return False;
- -- Otherwise it is assumed that all other statements may affect the
- -- control flow in some way. A raise statement may be expanded into
- -- a non-statement node.
- return Is_Statement (N) or else Is_Raise_Statement (N);
- end if;
+ return Is_Statement (N) or else Is_Raise_Statement (N);