From 96f1627c466b163050c0cc405175ef8d3c689b1a Mon Sep 17 00:00:00 2001 From: pierre Date: Thu, 5 Apr 2012 20:56:15 +0000 Subject: [PATCH] * Don't try to read sininfo record git-svn-id: trunk@20712 - --- rtl/openbsd/i386/sighnd.inc | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/rtl/openbsd/i386/sighnd.inc b/rtl/openbsd/i386/sighnd.inc index c4519a04b2..2f6f5ac730 100644 --- a/rtl/openbsd/i386/sighnd.inc +++ b/rtl/openbsd/i386/sighnd.inc @@ -15,11 +15,24 @@ CONST FPU_ALL=$7F; +{$ifdef cpui386} function getfpustate(sininfo:psiginfo):longint; {inline;} begin - getfpustate:=sininfo^.si_code; + if ptruint(sininfo)> high(word) then + getfpustate:=sininfo^.si_code + else + getfpustate:=word(ptruint(sininfo)); end; +function getaltfpustate(sigcontext:psigcontextrec):longint; {inline;} +begin + if assigned(sigcontext) then + getaltfpustate:=sigcontext^.sc_fpustate^.en_sw + else + getaltfpustate:=0; +end; +{$endif} + procedure SignalToRunerror(Sig: longint;sininfo:psiginfo; SigContext: PSigContextRec); public name '_FPC_DEFAULTSIGHANDLER'; cdecl; var @@ -40,8 +53,11 @@ begin { this is not allways necessary but I don't know yet how to tell if it is or not PM } res:=200; - fpustate:=GetFPUState(sininfo); - +{$ifdef cpui386} + fpustate:=GetaltFPUState(sigcontext); +{$else} + fpustate:=0; +{$endif} if (FpuState and FPU_All) <> 0 then begin { first check the more precise options }