OSDN Git Service

2008-08-01 Robert Dewar <dewar@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Aug 2008 09:31:06 +0000 (09:31 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Aug 2008 09:31:06 +0000 (09:31 +0000)
* sem_res.adb:
(Resolve_Call): Check violation of No_Specific_Termination_Handlers

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138501 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/sem_res.adb

index e011868..7a767a3 100644 (file)
@@ -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,