[Mono-bugs] [Bug 26506][Nor] Changed - Wrong branch target with loops and void-returning methods

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
9 Jul 2002 11:14:05 -0000


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 lupus@ximian.com.

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

--- shadow/26506	Mon Jul  8 18:07:08 2002
+++ shadow/26506.tmp.22944	Tue Jul  9 07:14:05 2002
@@ -68,6 +68,23 @@
 ------- Additional Comments From lupus@ximian.com  2002-07-08 10:47 -------
 Yes, I saw the bug in one of the System assemblies when compiled with mcs.
 
 ------- Additional Comments From miguel@ximian.com  2002-07-08 18:07 -------
 Ok, that is going to be quite tricky to fix.  I will think about a
 solution.
+
+------- Additional Comments From lupus@ximian.com  2002-07-09 07:14 -------
+A variation on the issue (this may have been caused by the fix to the
+original bug): when branching out of a try block, mcs needs to use
+leave, not br. The following sample make mcs insert a branch from
+inside the try to the outside of it.
+using System.Collections;
+class T {
+        static void Main () {
+                ArrayList list1;
+                foreach (object a in list1) {
+                        break;
+                }
+        }
+}
+Spotted this bug in the mcs-compiled System.dll, too.
+