mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 20:19:33 +02:00
Avoid range check errors
(cherry picked from commit 1351ccb3bf
)
# Conflicts:
# .gitattributes
This commit is contained in:
parent
62baa89646
commit
0558fefc51
@ -1375,8 +1375,8 @@ procedure TSingleEntryAtMinus4WithElse.DoTestIteration(Iteration: Integer);
|
|||||||
{ This helps catch errors where all branches, including else, are skipped }
|
{ This helps catch errors where all branches, including else, are skipped }
|
||||||
FResultStorage[Byte(Index)] := $FF;
|
FResultStorage[Byte(Index)] := $FF;
|
||||||
case Index of
|
case Index of
|
||||||
-4: FResultStorage[Index] := 1;
|
-4: FResultStorage[Byte(Index)] := 1;
|
||||||
else FResultStorage[Index] := 0;
|
else FResultStorage[Byte(Index)] := 0;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1609,8 +1609,8 @@ procedure TSingleEntryWithMinus1To5RangeWithElse.DoTestIteration(Iteration: Inte
|
|||||||
{ This helps catch errors where all branches, including else, are skipped }
|
{ This helps catch errors where all branches, including else, are skipped }
|
||||||
FResultStorage[Byte(Index)] := $FF;
|
FResultStorage[Byte(Index)] := $FF;
|
||||||
case Index of
|
case Index of
|
||||||
-1..5: FResultStorage[Index] := 1;
|
-1..5: FResultStorage[Byte(Index)] := 1;
|
||||||
else FResultStorage[Index] := 0;
|
else FResultStorage[Byte(Index)] := 0;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1658,8 +1658,8 @@ procedure TSingleEntryWithMinus1To50RangeWithElse.DoTestIteration(Iteration: Int
|
|||||||
{ This helps catch errors where all branches, including else, are skipped }
|
{ This helps catch errors where all branches, including else, are skipped }
|
||||||
FResultStorage[Byte(Index)] := $FF;
|
FResultStorage[Byte(Index)] := $FF;
|
||||||
case Index of
|
case Index of
|
||||||
-1..50: FResultStorage[Index] := 1;
|
-1..50: FResultStorage[Byte(Index)] := 1;
|
||||||
else FResultStorage[Index] := 0;
|
else FResultStorage[Byte(Index)] := 0;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1739,8 +1739,11 @@ procedure TExtremeRange2.DoTestIteration(Iteration: Integer);
|
|||||||
var
|
var
|
||||||
Index, Input: Word;
|
Index, Input: Word;
|
||||||
begin
|
begin
|
||||||
|
{$push}
|
||||||
|
{$r-}
|
||||||
Index := (Iteration and $FFFF);
|
Index := (Iteration and $FFFF);
|
||||||
Input := (Iteration and $1) - 1;
|
Input := (Iteration and $1) - 1;
|
||||||
|
{$pop}
|
||||||
FResultStorage[Index] := 0; { Covers $FFFF }
|
FResultStorage[Index] := 0; { Covers $FFFF }
|
||||||
case Input of
|
case Input of
|
||||||
0..$FFFD:
|
0..$FFFD:
|
||||||
@ -1826,8 +1829,11 @@ procedure TExtremeRange4.DoTestIteration(Iteration: Integer);
|
|||||||
var
|
var
|
||||||
Index, Input: Word;
|
Index, Input: Word;
|
||||||
begin
|
begin
|
||||||
|
{$push}
|
||||||
|
{$r-}
|
||||||
Index := (Iteration and $FFFF);
|
Index := (Iteration and $FFFF);
|
||||||
Input := (Iteration and $1) - 1;
|
Input := (Iteration and $1) - 1;
|
||||||
|
{$pop}
|
||||||
FResultStorage[Index] := 2; { Covers 1..$FFFE }
|
FResultStorage[Index] := 2; { Covers 1..$FFFE }
|
||||||
case Input of
|
case Input of
|
||||||
0:
|
0:
|
||||||
|
Loading…
Reference in New Issue
Block a user