Sfoglia il codice sorgente

* fixed (harmless) range check errors

git-svn-id: trunk@12710 -
Jonas Maebe 16 anni fa
parent
commit
7950db7f2f
1 ha cambiato i file con 18 aggiunte e 0 eliminazioni
  1. 18 0
      rtl/inc/variants.pp

+ 18 - 0
rtl/inc/variants.pp

@@ -2055,8 +2055,18 @@ begin
     try
       { Calculation total number of elements in the array }
       cnt:=1;
+{$ifopt r+}
+{ arr^.bounds[] is an array[0..0] }
+{$define rangeon}
+{$r-}
+{$endif}
       for i:=0 to arr^.dimcount - 1 do
         cnt:=cnt*cardinal(arr^.Bounds[i].ElementCount);
+{$ifdef rangeon}
+{$undef rangeon}
+{$r+}
+{$endif}
+
       { Clearing each element }
       for i:=1 to cnt do begin
         DoVarClear(data^);
@@ -2500,10 +2510,18 @@ begin
       else
         p:=src.vArray;
 
+{$ifopt r+}
+{$define rangeon}
+{$r-}
+{$endif}
       if highbound<p^.Bounds[p^.dimcount-1].LowBound-1 then
         VarInvalidArgError;
 
       newbounds.LowBound:=p^.Bounds[p^.dimcount-1].LowBound;
+{$ifdef rangon}
+{$undef rangeon}
+{$r+}
+{$endif}
       newbounds.ElementCount:=highbound-newbounds.LowBound+1;
 
       VarResultCheck(SafeArrayRedim(p,newbounds));