On some platforms no RTE is triggered when an exception occurs in a try..except and sysutils is not used
Original Reporter info from Mantis: Bart @flyingsheep
-
Reporter name: Bart Broersma
Original Reporter info from Mantis: Bart @flyingsheep
- Reporter name: Bart Broersma
Description:
program Test;
{$apptype console}
{$ifdef fpc}
{$mode objfpc}
{$endif fpc}
{$R+}
var
Arr: array[1..2] of integer;
i: Integer;
begin
i:=5;
try
try
Arr[i] := 1;
except
writeln('Except block');
end;
finally
writeln('Finally block');
end;
end.
On Windows it will output:
Runtime error 201 at $004015F1
$004015F1
$00407307
On Linux and OS/2 it will output:
Except block
Finally block
All this with fpc 3.2.0, but confirmed with fpc trunk on the fpc-devel ML.
As discussed in the fpc-devel ML the behaviour on Windows is correct: If SysUtils is not included, run-time
error should be raised regardless from the try..except block