* 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 -
This commit is contained in:
Jonas Maebe 2020-12-27 13:18:59 +00:00
parent 8ba4c4bcf0
commit 514db355b1

View File

@ -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 }