[fpc-devel] app compiled with fpc trunk crashes // Re: finally block entered twice, for only one "try". win64 seh

Martin Frb lazarus at mfriebe.de
Fri Dec 28 14:05:20 CET 2018


On 28/12/2018 03:53, Martin wrote:
> Ok I have this really weird issue. fpc 3.0.4 64 bit / built from svn tag.
Seem to me it is a bug in fpc, including todays trunk

program project1;
{$mode objfpc}
uses
   Classes;

procedure Foo(a: array of integer);
begin
   try
     writeln(a[0]);
     if a[0] = 1 then exit;
     writeln(a[0]);
   finally
     writeln(a[0]);
   end;
end;

begin
   foo([1]);
end.


On win64
compiled with todays trunk. -gh -gt -gw -O-

crashes, because the memory for "a" is freed twice. (the implicit 
finally block is called twice).




More information about the fpc-devel mailing list