From: Robert Dewar Date: Fri, 1 Aug 2008 09:31:06 +0000 (+0200) Subject: 2008-08-01 Robert Dewar X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9a7da240bb8918452ec5101794272c7715f2ed5d;p=gcc.git 2008-08-01 Robert Dewar * sem_res.adb: (Resolve_Call): Check violation of No_Specific_Termination_Handlers From-SVN: r138501 --- diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index e0118685ea0..7a767a39179 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -754,7 +754,22 @@ package body Sem_Res is C := N; loop P := Parent (C); + + -- If no parent, then we were not inside a subprogram, this can for + -- example happen when processing certain pragmas in a spec. Just + -- return False in this case. + + if No (P) then + return False; + end if; + + -- Done if we get to subprogram body, this is definitely an infinite + -- recursion case if we did not find anything to stop us. + exit when Nkind (P) = N_Subprogram_Body; + + -- If appearing in conditional, result is false + if Nkind_In (P, N_Or_Else, N_And_Then, N_If_Statement,