This patch fixes a bug in which if the environment task has a specific
termination handler, and that handler raises an exception, the handler
is called recursively, causing infinite recursion. The RM requires such
exceptions to be ignored.
gcc/ada/
* libgnarl/s-solita.adb (Task_Termination_Handler_T): Ignore all
exceptions propagated by Specific_Handler.
* libgnarl/s-tassta.adb, libgnarl/s-taskin.ads: Minor.
-- fall-back handler applies only to the dependent tasks of the task".
if Self_Id.Common.Specific_Handler /= null then
- Self_Id.Common.Specific_Handler.all (Cause, Self_Id, EO);
+ begin
+ Self_Id.Common.Specific_Handler.all (Cause, Self_Id, EO);
+ exception
+ -- RM-C.7.3(16) requires all exceptions raised here to be ignored
+
+ when others =>
+ null;
+ end;
end if;
end Task_Termination_Handler_T;
--
-- Protection: Self.L. Once a task has set Self.Stage to Completing, it
-- has exclusive access to this field.
- end record;
+ end record; -- Ada_Task_Control_Block
--------------------
-- Initialization --
if TH /= null then
begin
TH.all (Cause, Self_ID, EO);
-
exception
-
- -- RM-C.7.3 requires all exceptions raised here to be ignored
+ -- RM-C.7.3(16) requires all exceptions raised here to be ignored
when others =>
null;