mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 14:29:44 +02:00
* Fixed Linux FPU exception mapping for x86_64 and MIPS, might be still incomplete, but at least operations yielding NaNs no longer produce EAccessViolation.
git-svn-id: trunk@27194 -
This commit is contained in:
parent
47a7b117fd
commit
7ba4e67564
@ -31,19 +31,15 @@ begin
|
|||||||
|
|
||||||
case siginfo^.si_code of
|
case siginfo^.si_code of
|
||||||
FPE_INTDIV:
|
FPE_INTDIV:
|
||||||
res:=200;
|
res:=200; // maps to EDivByZero
|
||||||
FPE_INTOVF:
|
FPE_INTOVF:
|
||||||
res:=215;
|
res:=215;
|
||||||
FPE_FLTDIV:
|
FPE_FLTDIV:
|
||||||
res:=200;
|
res:=208; // maps to EZeroDivide
|
||||||
FPE_FLTOVF:
|
FPE_FLTOVF:
|
||||||
res:=205;
|
res:=205;
|
||||||
FPE_FLTUND:
|
FPE_FLTUND:
|
||||||
res:=206;
|
res:=206;
|
||||||
FPE_FLTRES,
|
|
||||||
FPE_FLTINV,
|
|
||||||
FPE_FLTSUB:
|
|
||||||
res:=216;
|
|
||||||
else
|
else
|
||||||
res:=207;
|
res:=207;
|
||||||
end;
|
end;
|
||||||
|
@ -22,9 +22,11 @@ const
|
|||||||
function GetFPUState(const SigContext : TSigContext) : word;
|
function GetFPUState(const SigContext : TSigContext) : word;
|
||||||
begin
|
begin
|
||||||
if assigned(SigContext.fpstate) then
|
if assigned(SigContext.fpstate) then
|
||||||
GetfpuState:=SigContext.fpstate^.swd;
|
GetfpuState:=SigContext.fpstate^.swd
|
||||||
|
else
|
||||||
|
GetFPUState:=0;
|
||||||
{$ifdef SYSTEM_DEBUG}
|
{$ifdef SYSTEM_DEBUG}
|
||||||
writeln('xx:',sigcontext.en_tw,' ',sigcontext.en_cw);
|
writeln('xx:',sigcontext.twd,' ',sigcontext.cwd);
|
||||||
{$endif SYSTEM_DEBUG}
|
{$endif SYSTEM_DEBUG}
|
||||||
{$ifdef SYSTEM_DEBUG}
|
{$ifdef SYSTEM_DEBUG}
|
||||||
Writeln(stderr,'FpuState = ',result);
|
Writeln(stderr,'FpuState = ',result);
|
||||||
@ -55,10 +57,8 @@ procedure SignalToRunerror(sig : longint; SigInfo: PSigInfo; SigContext: PSigCon
|
|||||||
res:=206
|
res:=206
|
||||||
else if (FpuState and FPU_Denormal)<>0 then
|
else if (FpuState and FPU_Denormal)<>0 then
|
||||||
res:=216
|
res:=216
|
||||||
else if (FpuState and (FPU_StackOverflow or FPU_StackUnderflow))<>0 Then
|
else if (FpuState and (FPU_StackOverflow or FPU_StackUnderflow or FPU_Invalid))<>0 Then
|
||||||
res:=207
|
res:=207
|
||||||
else if (FpuState and FPU_Invalid)<>0 then
|
|
||||||
res:=216
|
|
||||||
else
|
else
|
||||||
res:=207; {'Coprocessor Error'}
|
res:=207; {'Coprocessor Error'}
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user