[Mono-bugs] [Bug 52589][Wis] Changed - We allow break, continue, goto to exit a finally block

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 7 Jan 2004 08:48:58 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by bmaurer@users.sf.net.

http://bugzilla.ximian.com/show_bug.cgi?id=52589

--- shadow/52589	2004-01-07 01:16:43.000000000 -0500
+++ shadow/52589.tmp.7635	2004-01-07 08:48:58.000000000 -0500
@@ -57,6 +57,25 @@
 Then Break and Continue can check on: InFinally inside their
 InLoop tests and flag the more meaningful `can not leave the body
 of a finally clause'.
 
 The Goto statement is a different story.
 
+
+------- Additional Comments From bmaurer@users.sf.net  2004-01-07 08:48 -------
+I like your idea, but I think we can catch the goto case as well.
+
+When we do
+
+ec.PushFinally ();
+ec.PopFinally ();
+
+rather than changing a bool `InFinally' why dont we add a new field:
+
+int finally_level;
+
+and increment/deincrement it. Each loop and label would store the 
+finally level that it was at durring its decl. A break/continue/goto 
+statement would then check if its FinallyLevel was different than the 
+FinallyLevel of its enclosing loop. If they are different, than the 
+statement would cause the exiting of the FinallyLoop, and cause an 
+error.