Consider the following program:
program test;
var
a: array [1..3] of Integer;
i: Integer;
begin
for i := 1 to 4 do
a[i] := i;
end.The compiler will accept this code happily, despite the fact that there's an out of bounds array index when i = 4.
Since the behavior of for loop in FPC (at least in non Delphi / TP mode) is deterministic, it should be possible to check whether the index is out of bounds or not. Isn't it? Or is there any situation where it's not?
