Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2018-07

Issue #32913

6 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

J. Gareth Moreton

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

Reply by email

Dmitry Boyarintsev
to J. Gareth Moreton

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

J. Gareth Moreton wrote 23 lines
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 - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Martok
to Dmitry Boyarintsev
Dmitry Boyarintsev wrote

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

Reply by email

R0b0t1
to Martok
Martok wrote 10 lines
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

Reply by email

J. Gareth Moreton

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 sent:

Show quoted text 26 lines
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 - 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

Reply by email

Sven Barth
to R0b0t1: Are they not allowed in a finally clause? If the above is true then this confuses me.…

R0b0t1 schrieb am Sa., 14. Juli 2018, 21:11:

Show quoted text 10 lines
> 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

Reply by email