Browse Source

fcl-base: fixed range check error

mattias 3 years ago
parent
commit
ec6f328822
2 changed files with 3 additions and 2 deletions
  1. 3 0
      packages/fcl-base/src/contnrs.pp
  2. 0 2
      packages/fcl-base/src/pascodegen.pp

+ 3 - 0
packages/fcl-base/src/contnrs.pp

@@ -15,6 +15,7 @@
 {$endif}
 {$H+}
 {$ifdef CLASSESINLINE}{$inline on}{$endif}
+{$IFOPT R+}{$DEFINE RangeChecking}{$ENDIF}
 
 unit Contnrs;
 
@@ -1928,6 +1929,7 @@ end;
 
 { Default hash Function }
 
+{$IFDEF RangeChecking}{$R-}{$ENDIF}
 Function RSHash(const S: string; const TableSize: Longword): Longword;
 const
   b = 378551;
@@ -1945,6 +1947,7 @@ begin
       end;
   Result:=(Result and $7FFFFFFF) mod TableSize;
 end;
+{$IFDEF RangeChecking}{$R+}{$ENDIF}
 
 { THTNode }
 

+ 0 - 2
packages/fcl-base/src/pascodegen.pp

@@ -194,8 +194,6 @@ begin
   AddLn('}');
 end;
 
-
-
 constructor TPascalCodeGenerator.Create(AOwner: TComponent);
 begin
   inherited Create(AOwner);