From 79c8234c8bcf7181899d83a77142e9ebb857a95b Mon Sep 17 00:00:00 2001 From: pierre Date: Wed, 15 Feb 2012 13:20:26 +0000 Subject: [PATCH] Protect against nil values for info or SigContext git-svn-id: trunk@20356 - --- rtl/netbsd/i386/sighnd.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rtl/netbsd/i386/sighnd.inc b/rtl/netbsd/i386/sighnd.inc index 46bb3f927f..2809586ad8 100644 --- a/rtl/netbsd/i386/sighnd.inc +++ b/rtl/netbsd/i386/sighnd.inc @@ -55,7 +55,10 @@ begin { this is not allways necessary but I don't know yet how to tell if it is or not PM } res:=200; - fpustate:=info^._info.si_code; + if assigned(info) then + fpustate:=info^._info.si_code + else + fpustate:=FPE_IntDiv; { if (FpuState and FPU_All) <> 0 then } begin @@ -91,7 +94,10 @@ begin if res<>0 then begin {$ifdef cpui386} - HandleErrorAddrFrame(res,pointer(SigContext^.sc_eip),pointer(SigContext^.sc_ebp)); + if assigned(SigContext) then + HandleErrorAddrFrame(res,pointer(SigContext^.sc_eip),pointer(SigContext^.sc_ebp)) + else + HandleErrorAddrFrame(res,nil,nil); {$endif} end; end;