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
Post by 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
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Martok
2018-07-14 18:54:36 UTC
Permalink
Raw Message
Post by 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
Post by Martok
Post by 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
<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?
Post by Martok
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
Post by R0b0t1
Post by Martok
Control flow statements are allowed in an EXCEPT block. Come to think of
it,
Post by Martok
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
Post by R0b0t1
Post by Martok
Control flow statements are allowed in an EXCEPT block. Come to think of
it,
Post by Martok
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  _______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel [1]
------
[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...