]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Align VxWorks version of System.Interrupts
authorRonan Desplanques <desplanques@adacore.com>
Tue, 27 Jan 2026 11:56:42 +0000 (12:56 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 26 May 2026 08:38:18 +0000 (10:38 +0200)
A recent minor fix to the main System.Interrupts was omitted for the
VxWorks-specific version. This patch fixes this.

gcc/ada/ChangeLog:

* libgnarl/s-interr__vxworks.adb (Unprotected_Exchange_Handler): Fix
exception message.

gcc/ada/libgnarl/s-interr__vxworks.adb

index 035d7bac8bf66901a581b2f05faf869b86b6792a..9d5ab389758f036c76074fa536409dc14f67e738 100644 (file)
@@ -866,20 +866,22 @@ package body System.Interrupts is
          --  We don't check anything if Restoration is True, since we may be
          --  detaching a static handler to restore a dynamic one.
 
-         if not Restoration and then not Static
-           and then (User_Handler (Interrupt).Static
-
+         if not Restoration and then not Static then
             --  Trying to overwrite a static Interrupt Handler with a dynamic
             --  Handler
+            if User_Handler (Interrupt).Static then
+               raise Program_Error
+                 with
+                   "trying to overwrite a static Interrupt Handler with a "
+                   & "dynamic handler";
+            end if;
 
-            --  The new handler is not specified as an Interrupt Handler by a
-            --  pragma.
-
-           or else not Is_Registered (New_Handler))
-         then
-            raise Program_Error with
-               "trying to overwrite a static interrupt handler with a "
-               & "dynamic handler";
+            --  The new handler is not specified as an interrupt handler by an
+            --  aspect (see the second sentence of RM C.3.2 (17/3)).
+            if not Is_Registered (New_Handler) then
+               raise Program_Error
+                 with "trying to attach procedure without Interrupt_Handler";
+            end if;
          end if;
 
          --  Save the old handler