Browse Source

Merged revisions 5273,5278,5314-5315 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r5273 | yury | 2006-11-07 11:32:27 +0100 (Di, 07 Nov 2006) | 1 line

* removed runtime error on unhandled exception when SysUtils is used.
........
r5314 | jonas | 2006-11-10 21:32:20 +0100 (Fr, 10 Nov 2006) | 3 lines

* exit with exitcode 217 instead of some random OS result
on an unhandled exception
........
r5315 | jonas | 2006-11-10 21:45:59 +0100 (Fr, 10 Nov 2006) | 2 lines

* fixed range errors
........

git-svn-id: branches/fixes_2_0@5864 -

florian 19 years ago
parent
commit
33ae5a989a
2 changed files with 7 additions and 4 deletions
  1. 4 1
      rtl/inc/except.inc
  2. 3 3
      rtl/unix/timezone.inc

+ 4 - 1
rtl/inc/except.inc

@@ -151,7 +151,10 @@ Procedure DoUnHandledException;
 begin
 begin
   If (ExceptProc<>Nil) and (ExceptObjectStack<>Nil) then
   If (ExceptProc<>Nil) and (ExceptObjectStack<>Nil) then
     with ExceptObjectStack^ do
     with ExceptObjectStack^ do
-      TExceptProc(ExceptProc)(FObject,Addr,FrameCount,Frames);
+      begin
+        TExceptProc(ExceptProc)(FObject,Addr,FrameCount,Frames);
+        halt(217)
+      end;
   if erroraddr = nil then
   if erroraddr = nil then
     RunError(217)
     RunError(217)
   else
   else

+ 3 - 3
rtl/unix/timezone.inc

@@ -154,7 +154,7 @@ var
   
   
   function readbufbyte: byte;
   function readbufbyte: byte;
   begin
   begin
-    if bufptr >= @buf[bufsize] then
+    if bufptr > @buf[bufsize-1] then
       readfilebuf;
       readfilebuf;
     readbufbyte := bufptr^;
     readbufbyte := bufptr^;
     inc(bufptr);
     inc(bufptr);
@@ -166,7 +166,7 @@ var
   begin
   begin
     readbuf := 0;
     readbuf := 0;
     repeat
     repeat
-      numbytes := @buf[bufsize] - bufptr;
+      numbytes := @buf[bufsize-1] - bufptr + 1;
       if numbytes > count then
       if numbytes > count then
         numbytes := count;
         numbytes := count;
       if numbytes > 0 then
       if numbytes > 0 then
@@ -203,7 +203,7 @@ begin
   f:=fpopen(fn,Open_RdOnly);
   f:=fpopen(fn,Open_RdOnly);
   if f<0 then
   if f<0 then
    exit;
    exit;
-  bufptr := @buf[bufsize];
+  bufptr := @buf[bufsize-1]+1;
   i:=readbuf(tzhead,sizeof(tzhead));
   i:=readbuf(tzhead,sizeof(tzhead));
   if i<>sizeof(tzhead) then
   if i<>sizeof(tzhead) then
    exit;
    exit;