Browse Source

Protect against nil values for info or SigContext

git-svn-id: trunk@20356 -
pierre 13 years ago
parent
commit
79c8234c8b
1 changed files with 8 additions and 2 deletions
  1. 8 2
      rtl/netbsd/i386/sighnd.inc

+ 8 - 2
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;