Browse Source

* darwin/AArch64: always clear fpu exception flags regardless of the
triggered signal, as the kernel currently triggers SIGILL rather
than SIGFPE for FPU exceptions

git-svn-id: trunk@47858 -

Jonas Maebe 4 years ago
parent
commit
514db355b1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      rtl/darwin/aarch64/sighnd.inc

+ 2 - 2
rtl/darwin/aarch64/sighnd.inc

@@ -32,8 +32,6 @@ begin
           Else
           Else
             Res:=207; {coprocessor error}
             Res:=207; {coprocessor error}
         end;
         end;
-        { clear "exception happened" flags }
-        SigContext^.uc_mcontext^.__fs.__fpsr:=SigContext^.uc_mcontext^.__fs.__fpsr and not(fpu_exception_mask shr fpu_exception_mask_to_status_mask_shift);
       end;
       end;
     SIGBUS:
     SIGBUS:
         res:=214;
         res:=214;
@@ -45,6 +43,8 @@ begin
     SIGQUIT:
     SIGQUIT:
         res:=233;
         res:=233;
   end;
   end;
+  { right now, macOS generates SIGILL signals for fpu exceptions, so always clear the fpu exceptions }
+  SigContext^.uc_mcontext^.__fs.__fpsr:=SigContext^.uc_mcontext^.__fs.__fpsr and not(fpu_exception_mask shr fpu_exception_mask_to_status_mask_shift);
   {$ifdef FPC_USE_SIGPROCMASK}
   {$ifdef FPC_USE_SIGPROCMASK}
    reenable_signal(sig);
    reenable_signal(sig);
   {$endif }
   {$endif }