[Mono-bugs] [Bug 74565][Nor] New - Flow analysis failing for finally detection.
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sun, 10 Apr 2005 13:46:44 -0400 (EDT)
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 miguel@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=74565
--- shadow/74565 2005-04-10 13:46:44.000000000 -0400
+++ shadow/74565.tmp.1704 2005-04-10 13:46:44.000000000 -0400
@@ -0,0 +1,50 @@
+Bug#: 74565
+Product: Mono: Compilers
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: miguel@ximian.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Flow analysis failing for finally detection.
+
+In the iterators code we have this code:
+
+iterators.cs:
+
+ if (ec.CurrentBranching.InFinally (true)){
+ Report.Error (1625, loc, "Cannot yield in the body of a " +
+ "finally clause");
+ return false;
+ }
+
+But this code is not triggered with the file: cs1625-2.cs from the errors
+directory, even if the code is inside a finally:
+
+using System;
+using System.Collections;
+
+class X
+{
+ public static IEnumerable Test (int a)
+ {
+ try {
+ ;
+ } finally {
+ try {
+ yield return 0;
+ }
+ finally {}
+ }
+ }
+}
+
+This leads to a compiler crash.