[fpc-pascal] "Continue" not work properly in except clause on win64
Toru Takubo
takubo at e-parcel.co.jp
Fri Aug 28 12:19:40 CEST 2015
On 2015/08/28 18:56, Sven Barth wrote:
> Am 28.08.2015 11:08 schrieb "Toru Takubo" <takubo at e-parcel.co.jp <mailto:takubo at e-parcel.co.jp>>:
> >
> > Hi all,
> >
> > I'm trying FPC 3.0.0-rc1 and find "Continue" does not work properly
> > in except clause but just jump to finally clause on win64.
> >
> > Here is a sample code:
> > ----------------------------
> > program sample;
> >
> > {$mode objfpc}
> >
> > uses
> > SysUtils;
> > var
> > i: Integer;
> > begin
> > try
> > for i:=0 to 2 do begin
> > try
> > Writeln(IntToStr(i));
> > raise Exception.Create('');
> > except
> > Continue;
> > end;
> > end;
> > finally
> > Writeln('done.');
> > Readln;
> > end;
> > end.
> > ----------------------------
> >
> > The result on win32:
> > ----------------------------
> > 0
> > 1
> > 2
> > done.
> > ----------------------------
> >
> > The result on win64
> > ----------------------------
> > 0
> > done.
> > ----------------------------
> >
> > Why such difference? Is this a bug?
>
> It's because since 2.7.1 a different exception handling mechanism is used on Win64 (and also Win32 if enabled). But yes, it should probably be considered as a bug, so please file a bug report. As a workaround you could use a boolean variable that you set inside the handler and evaluate it afterwards.
>
> Regards,
> Sven
>
Thank you for your explanation. I will submit a bug report.
Regards,
Toru
More information about the fpc-pascal
mailing list