ソースを参照

* Added back pre-r17129 configuration of string range check helpers under {$ifdef ver2_4}. Without it, bootstrapping with 2.4.4 and -Cr is broken.

git-svn-id: trunk@17715 -
sergei 14 年 前
コミット
829ee9828d
4 ファイル変更65 行追加0 行削除
  1. 14 0
      rtl/inc/astrings.inc
  2. 21 0
      rtl/inc/compproc.inc
  3. 15 0
      rtl/inc/ustrings.inc
  4. 15 0
      rtl/inc/wstrings.inc

+ 14 - 0
rtl/inc/astrings.inc

@@ -538,13 +538,27 @@ begin
       result:=CompareByte(S1[1],S2[1],MaxI);
 end;
 
+{$ifdef VER2_4}
+// obsolete but needed for boostrapping with 2.4
+Procedure fpc_AnsiStr_CheckZero(p : pointer);[Public,Alias : 'FPC_ANSISTR_CHECKZERO'];  compilerproc;
+begin
+  if p=nil then
+    HandleErrorFrame(201,get_frame);
+end;
 
+Procedure fpc_AnsiStr_CheckRange(len,index : SizeInt);[Public,Alias : 'FPC_ANSISTR_RANGECHECK'];  compilerproc;
+begin
+  if (index>len) or (Index<1) then
+    HandleErrorFrame(201,get_frame);
+end;
 
+{$else VER2_4}
 Procedure fpc_AnsiStr_CheckRange(p: Pointer; index: SizeInt);[Public,Alias : 'FPC_ANSISTR_RANGECHECK'];  compilerproc;
 begin
   if (p=nil) or (index>PAnsiRec(p-FirstOff)^.Len) or (Index<1) then
     HandleErrorFrame(201,get_frame);
 end;
+{$endif VER2_4}
 
 Procedure fpc_AnsiStr_SetLength (Var S : AnsiString; l : SizeInt);[Public,Alias : 'FPC_ANSISTR_SETLENGTH'];  compilerproc;
 {

+ 21 - 0
rtl/inc/compproc.inc

@@ -278,7 +278,14 @@ procedure fpc_ansistr_to_chararray(out res: array of char; const src: ansistring
 {$endif ndef FPC_STRTOCHARARRAYPROC}
 Function fpc_AnsiStr_Compare(const S1,S2 : AnsiString): SizeInt; compilerproc;
 Function fpc_AnsiStr_Compare_equal(const S1,S2 : AnsiString): SizeInt; compilerproc;
+{$ifdef VER2_4}
+// obsolete but needed for bootstrapping with 2.4
+Procedure fpc_AnsiStr_CheckZero(p : pointer); compilerproc;
+Procedure fpc_AnsiStr_CheckRange(len,index : SizeInt); compilerproc;
+{$else VER2_4}
 Procedure fpc_AnsiStr_CheckRange(p : Pointer; index : SizeInt); compilerproc;
+{$endif VER2_4}
+
 Procedure fpc_AnsiStr_SetLength (Var S : AnsiString; l : SizeInt); compilerproc;
 Function  fpc_ansistr_Copy (Const S : AnsiString; Index,Size : SizeInt) : AnsiString;compilerproc;
 {$ifdef EXTRAANSISHORT}
@@ -326,7 +333,14 @@ procedure fpc_widestr_to_widechararray(out res: array of widechar; const src: Wi
 {$endif ndef FPC_STRTOCHARARRAYPROC}
 Function fpc_WideStr_Compare(const S1,S2 : WideString): SizeInt; compilerproc;
 Function fpc_WideStr_Compare_equal(const S1,S2 : WideString): SizeInt; compilerproc;
+{$ifdef VER2_4}
+// obsolete but needed for bootstrapping with 2.4
+Procedure fpc_WideStr_CheckZero(p : pointer); compilerproc;
+Procedure fpc_WideStr_CheckRange(len,index : SizeInt); compilerproc;
+{$else VER2_4}
 Procedure fpc_WideStr_CheckRange(p: Pointer; index : SizeInt); compilerproc;
+{$endif VER2_4}
+
 Procedure fpc_WideStr_SetLength (Var S : WideString; l : SizeInt); compilerproc;
 Function  fpc_widestr_Copy (Const S : WideString; Index,Size : SizeInt) : WideString;compilerproc;
 {$ifndef FPC_WINLIKEWIDESTRING}
@@ -411,7 +425,14 @@ procedure fpc_unicodestr_to_widechararray(out res: array of widechar; const src:
 {$endif VER2_2}
 Function fpc_UnicodeStr_Compare(const S1,S2 : UnicodeString): SizeInt; compilerproc;
 Function fpc_UnicodeStr_Compare_equal(const S1,S2 : UnicodeString): SizeInt; compilerproc;
+{$ifdef VER2_4}
+// obsolete but needed for bootstrapping with 2.4
+Procedure fpc_UnicodeStr_CheckZero(p : pointer); compilerproc;
+Procedure fpc_UnicodeStr_CheckRange(len,index : SizeInt); compilerproc;
+{$else VER2_4}
 Procedure fpc_UnicodeStr_CheckRange(p: Pointer; index : SizeInt); compilerproc;
+{$endif VER2_4}
+
 Procedure fpc_UnicodeStr_SetLength (Var S : UnicodeString; l : SizeInt); compilerproc;
 Function  fpc_unicodestr_Copy (Const S : UnicodeString; Index,Size : SizeInt) : UnicodeString;compilerproc;
 function fpc_unicodestr_Unique(Var S : Pointer): Pointer; compilerproc;

+ 15 - 0
rtl/inc/ustrings.inc

@@ -1304,12 +1304,27 @@ begin
     exit(CompareWord(S1[1],S2[1],MaxI));
 end;
 
+{$ifdef VER2_4}
+// obsolete but needed for bootstrapping with 2.4
+Procedure fpc_UnicodeStr_CheckZero(p : pointer);[Public,Alias : 'FPC_UNICODESTR_CHECKZERO']; compilerproc;
+begin
+  if p=nil then
+    HandleErrorFrame(201,get_frame);
+end;
+
+Procedure fpc_UnicodeStr_CheckRange(len,index : SizeInt);[Public,Alias : 'FPC_UNICODESTR_RANGECHECK']; compilerproc;
+begin
+  if (index>len div 2) or (Index<1) then
+    HandleErrorFrame(201,get_frame);
+end;
 
+{$else VER2_4}
 Procedure fpc_UnicodeStr_CheckRange(p: Pointer; index: SizeInt);[Public,Alias : 'FPC_UNICODESTR_RANGECHECK']; compilerproc;
 begin
   if (p=nil) or (index>PUnicodeRec(p-UnicodeFirstOff)^.len div 2) or (Index<1) then
     HandleErrorFrame(201,get_frame);
 end;
+{$endif VER2_4}
 
 Procedure fpc_UnicodeStr_SetLength(Var S : UnicodeString; l : SizeInt);[Public,Alias : 'FPC_UNICODESTR_SETLENGTH']; compilerproc;
 {

+ 15 - 0
rtl/inc/wstrings.inc

@@ -729,12 +729,27 @@ begin
     exit(CompareWord(S1[1],S2[1],MaxI));
 end;
 
+{$ifdef VER2_4}
+// obsolete but needed for bootstrapping with 2.4
+Procedure fpc_WideStr_CheckZero(p : pointer);[Public,Alias : 'FPC_WIDESTR_CHECKZERO']; compilerproc;
+begin
+  if p=nil then
+    HandleErrorFrame(201,get_frame);
+end;
+
+Procedure fpc_WideStr_CheckRange(len,index : SizeInt);[Public,Alias : 'FPC_WIDESTR_RANGECHECK']; compilerproc;
+begin
+  if (index>len div 2) or (Index<1) then
+    HandleErrorFrame(201,get_frame);
+end;
 
+{$else VER2_4}
 Procedure fpc_WideStr_CheckRange(p: Pointer; index: SizeInt);[Public,Alias : 'FPC_WIDESTR_RANGECHECK']; compilerproc;
 begin
   if (p=nil) or (index>PWideRec(p-WideFirstOff)^.len div 2) or (Index<1) then
     HandleErrorFrame(201,get_frame);
 end;
+{$endif VER2_4}
 
 Procedure fpc_WideStr_SetLength(Var S : WideString; l : SizeInt);[Public,Alias : 'FPC_WIDESTR_SETLENGTH']; compilerproc;
 {