فهرست منبع

* fixed Index* for 64 Bit CPUs
* use forward move as much as possible

git-svn-id: trunk@8778 -

florian 18 سال پیش
والد
کامیت
96eaeeaf98
1فایلهای تغییر یافته به همراه4 افزوده شده و 3 حذف شده
  1. 4 3
      rtl/inc/generic.inc

+ 4 - 3
rtl/inc/generic.inc

@@ -29,7 +29,7 @@ var
 begin
 begin
   if (@dest=@source) or (count<=0) then
   if (@dest=@source) or (count<=0) then
     exit;
     exit;
-  if @dest<@source then
+  if (@dest<@source) or (@source+count<@dest) then
     begin
     begin
       { Forward Move }
       { Forward Move }
       psrc:=@source;
       psrc:=@source;
@@ -269,7 +269,8 @@ begin
   { simulate assembler implementations behaviour, which is expected }
   { simulate assembler implementations behaviour, which is expected }
   { fpc_pchar_to_ansistr in astrings.inc                            }
   { fpc_pchar_to_ansistr in astrings.inc                            }
   if (len < 0) or
   if (len < 0) or
-     (len > high(PtrUInt) div 2) or
+     { is this ever true? }
+     (len > high(PtrInt)) or
      (psrc+len < psrc) then
      (psrc+len < psrc) then
     pend:=pword(high(PtrUInt)-sizeof(word))
     pend:=pword(high(PtrUInt)-sizeof(word))
   else
   else
@@ -297,7 +298,7 @@ begin
   { simulate assembler implementations behaviour, which is expected }
   { simulate assembler implementations behaviour, which is expected }
   { fpc_pchar_to_ansistr in astrings.inc                            }
   { fpc_pchar_to_ansistr in astrings.inc                            }
   if (len < 0) or
   if (len < 0) or
-     (len > high(PtrUInt) div 4) or
+     (len > high(PtrInt) div 2) or
      (psrc+len < psrc) then
      (psrc+len < psrc) then
     pend:=pdword(high(PtrUInt)-sizeof(dword))
     pend:=pdword(high(PtrUInt)-sizeof(dword))
   else
   else