Discussion:
Issue #32913
(too old to reply)
J. Gareth Moreton
2018-07-14 17:23:46 UTC
Permalink
Raw Message
I've had a look at issue #32913 for a
while now, but after looking through
errore.msg on an unrelated note, I
discovered that it seems to be the
intention that Exit is not supported in
the finally section of a try...finally
block, although apparently such a
construct is supported in Delphi.

Do-wan Kim provided a fix for the internal
error, but the original submitter states
that Delphi allows Exit in finally
sections, something I cannot personally
test. How should I proceed from here? If
in ObjFPC mode, Exit is indeed illegal, I
can fix that so the presence of Exit
returns the relevant error.

Gareth aka Kit
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://li
Dmitry Boyarintsev
2018-07-14 18:41:04 UTC
Permalink
Raw Message
Exiting from finally? Is it something new?0

http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/cm_cant_leave_finally_xml.html

On Saturday, July 14, 2018, J. Gareth Moreton <***@moreton-family.com>
wrote:

> I've had a look at issue #32913 for a
> while now, but after looking through
> errore.msg on an unrelated note, I
> discovered that it seems to be the
> intention that Exit is not supported in
> the finally section of a try...finally
> block, although apparently such a
> construct is supported in Delphi.
>
> Do-wan Kim provided a fix for the internal
> error, but the original submitter states
> that Delphi allows Exit in finally
> sections, something I cannot personally
> test. How should I proceed from here? If
> in ObjFPC mode, Exit is indeed illegal, I
> can fix that so the presence of Exit
> returns the relevant error.
>
> Gareth aka Kit
> _______________________________________________
> fpc-devel maillist - fpc-***@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
>
Martok
2018-07-14 18:54:36 UTC
Permalink
Raw Message
Am 14.07.2018 um 20:41 schrieb Dmitry Boyarintsev:
> Exiting from finally? Is it something new?0
>
> http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/cm_cant_leave_finally_xml.html
Still documented for Tokyo:
<http://docwiki.embarcadero.com/RADStudio/Tokyo/en/E2126_Cannot_BREAK,_CONTINUE_or_EXIT_out_of_a_FINALLY_clause_%28Delphi%29>

Although the example is of course wrong, the way it's given would be 'E2097
BREAK or CONTINUE outside of loop'. Just substitute "break" with "exit".

Control flow statements are allowed in an EXCEPT block. Come to think of it,
didn't we have another TRY/FINALLY/EXCEPT nesting issue that might have
something to do with that?

--
Regards,
Martok

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepasca
R0b0t1
2018-07-14 19:11:08 UTC
Permalink
Raw Message
On Sat, Jul 14, 2018 at 1:54 PM, Martok <***@martoks-place.de> wrote:
> Am 14.07.2018 um 20:41 schrieb Dmitry Boyarintsev:
>> Exiting from finally? Is it something new?0
>>
>> http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/cm_cant_leave_finally_xml.html
> Still documented for Tokyo:
> <http://docwiki.embarcadero.com/RADStudio/Tokyo/en/E2126_Cannot_BREAK,_CONTINUE_or_EXIT_out_of_a_FINALLY_clause_%28Delphi%29>
>
> Although the example is of course wrong, the way it's given would be 'E2097
> BREAK or CONTINUE outside of loop'. Just substitute "break" with "exit".
>

Are they not allowed in a finally clause?

> Control flow statements are allowed in an EXCEPT block. Come to think of it,
> didn't we have another TRY/FINALLY/EXCEPT nesting issue that might have
> something to do with that?
>

If the above is true then this confuses me. Except should run before
finally, so if you use flow control in an except block then the
finally clause "shouldn't" run.

Cheers,
R0b0t1
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-de
Sven Barth via fpc-devel
2018-07-14 20:58:59 UTC
Permalink
Raw Message
R0b0t1 <***@gmail.com> schrieb am Sa., 14. Juli 2018, 21:11:

> > Control flow statements are allowed in an EXCEPT block. Come to think of
> it,
> > didn't we have another TRY/FINALLY/EXCEPT nesting issue that might have
> > something to do with that?
> >
>
> If the above is true then this confuses me. Except should run before
> finally, so if you use flow control in an except block then the
> finally clause "shouldn't" run.
>

A "finally"-block is supposed to be executed no matter which way the
"try"-part is left: normally, with an exception or by using exit
("goto"-statements with a target outside the block are not allowed).

Regards,
Sven

>
J. Gareth Moreton
2018-07-14 20:56:16 UTC
Permalink
Raw Message
Slightly embarrassing, but I forgot some of the details because I put this on the
backburner for a few weeks. The Exit wasn't inside a "finally" section, but
inside the "try" part - however, the entire block was in an "except" section.

I'll double check that Exit is not allowed in the finally segment. Apologies!

Gareth aka. Kit


On Sat 14/07/18 21:58 , Sven Barth via fpc-devel fpc-***@lists.freepascal.org sent:
> R0b0t1 schrieb am Sa., 14. Juli 2018, 21:11:
> > Control flow statements are allowed in an EXCEPT block. Come to think of
> it,
> > didn't we have another TRY/FINALLY/EXCEPT nesting issue that might have
> > something to do with that?
> >
>
> If the above is true then this confuses me. Except should run before
> finally, so if you use flow control in an except block then the
> finally clause "shouldn't" run.
>
> A "finally"-block is supposed to be executed no matter which way the
> "try"-part is left: normally, with an exception or by using exit
> ("goto"-statements with a target outside the block are not allowed). 
> Regards, Sven  _______________________________________________
> fpc-devel maillist - fpc-***@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel [1]
>
>
>
> Links:
> ------
> [1]
> http://secureweb.fast.net.uk/parse.php?redirect=http://lists.freepascal.org
> /cgi-bin/mailman/listinfo/fpc-devel
>

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailm
Loading...