From 96eaeeaf983baca14f0963fbfe8d9925f7a594e1 Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 13 Oct 2007 19:06:41 +0000 Subject: [PATCH] * fixed Index* for 64 Bit CPUs * use forward move as much as possible git-svn-id: trunk@8778 - --- rtl/inc/generic.inc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rtl/inc/generic.inc b/rtl/inc/generic.inc index b8ec1c6ae1..17fcc1a236 100644 --- a/rtl/inc/generic.inc +++ b/rtl/inc/generic.inc @@ -29,7 +29,7 @@ var begin if (@dest=@source) or (count<=0) then exit; - if @dest<@source then + if (@dest<@source) or (@source+count<@dest) then begin { Forward Move } psrc:=@source; @@ -269,7 +269,8 @@ begin { simulate assembler implementations behaviour, which is expected } { fpc_pchar_to_ansistr in astrings.inc } if (len < 0) or - (len > high(PtrUInt) div 2) or + { is this ever true? } + (len > high(PtrInt)) or (psrc+len < psrc) then pend:=pword(high(PtrUInt)-sizeof(word)) else @@ -297,7 +298,7 @@ begin { simulate assembler implementations behaviour, which is expected } { fpc_pchar_to_ansistr in astrings.inc } if (len < 0) or - (len > high(PtrUInt) div 4) or + (len > high(PtrInt) div 2) or (psrc+len < psrc) then pend:=pdword(high(PtrUInt)-sizeof(dword)) else