Pārlūkot izejas kodu

* 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 gadi atpakaļ
vecāks
revīzija
514db355b1
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      rtl/darwin/aarch64/sighnd.inc

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

@@ -32,8 +32,6 @@ begin
           Else
             Res:=207; {coprocessor error}
         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;
     SIGBUS:
         res:=214;
@@ -45,6 +43,8 @@ begin
     SIGQUIT:
         res:=233;
   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}
    reenable_signal(sig);
   {$endif }