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).

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to