Browse Source

--- Merging r20355 into '.':
U rtl/netbsd/signal.inc
--- Merging r20356 into '.':
U rtl/netbsd/i386/sighnd.inc

# revisions: 20355,20356
------------------------------------------------------------------------
r20355 | pierre | 2012-02-15 14:19:22 +0100 (Wed, 15 Feb 2012) | 1 line
Changed paths:
M /trunk/rtl/netbsd/signal.inc

Fix SigActionRec record field order
------------------------------------------------------------------------
------------------------------------------------------------------------
r20356 | pierre | 2012-02-15 14:20:26 +0100 (Wed, 15 Feb 2012) | 1 line
Changed paths:
M /trunk/rtl/netbsd/i386/sighnd.inc

Protect against nil values for info or SigContext
------------------------------------------------------------------------

git-svn-id: branches/fixes_2_6@20365 -

marco 13 years ago
parent
commit
f9adc628f3
2 changed files with 9 additions and 3 deletions
  1. 8 2
      rtl/netbsd/i386/sighnd.inc
  2. 1 1
      rtl/netbsd/signal.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;

+ 1 - 1
rtl/netbsd/signal.inc

@@ -225,8 +225,8 @@ struct sigcontext {
 //        0: (Sh: SignalHandler);
 //        1: (Sa: TSigAction);
 //      end;
-    Sa_Flags    : Longint;
     Sa_Mask     : SigSet;
+    Sa_Flags    : Longint;
   end;
 
   PSigActionRec = ^SigActionRec;