Hello,

FPC 3.0.4, Linux i386

the following program should catch the floating point exception
(always), but crashes on the fourth call to the procedure Run:

program test;
{$mode objfpc}{$H+}

procedure Run;
var
   r: Real;
   i: Integer;
begin
   i:= 1;
   try
      r:= i / 0.0;
   except
      r:= 0; // Crash  here on fourth call.
   end;
   Writeln('ok');
end;

begin
   Run;
   Run;
   Run;
   Run;
end.

The output:
ok
ok
ok
Runtime error 207 at $080480F9
  $080480F9
  $0804815C
  $0806644D

The program was compiled with no additional compiler parameters.
I could not reproduce this problem with the trunk version of the
compiler, but all versions down to 2.2.2 show the described behavior.
FPC 2.2.0 is working correct. The 64-bit version of FPC 3.0.4 works
correct too.

Is this something for the bug tracker?

Regards, Bernd.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to