aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2008-08-01 11:31:06 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-08-01 11:31:06 +0200
commit9a7da240bb8918452ec5101794272c7715f2ed5d (patch)
treeb29111d2283738ee355a0ad6e94a0dde69d7d5f7 /gcc
parenta30a01fea9e4c3ba6da8a4ca06446572ba9851ee (diff)
downloadgcc-9a7da240bb8918452ec5101794272c7715f2ed5d.zip
gcc-9a7da240bb8918452ec5101794272c7715f2ed5d.tar.gz
gcc-9a7da240bb8918452ec5101794272c7715f2ed5d.tar.bz2
2008-08-01 Robert Dewar <dewar@adacore.com>
* sem_res.adb: (Resolve_Call): Check violation of No_Specific_Termination_Handlers From-SVN: r138501
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_res.adb15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index e011868..7a767a3 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,