[Mono-bugs] [Bug 26506][Nor] Changed - Implicit Leave opcode generated breaks generated images. Need workaround

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
9 Jul 2002 19:23:37 -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 miguel@ximian.com.

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

--- shadow/26506	Tue Jul  9 07:14:05 2002
+++ shadow/26506.tmp.2882	Tue Jul  9 15:23:37 2002
@@ -11,13 +11,13 @@
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: lupus@ximian.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
-Summary: Wrong branch target with loops and void-returning methods
+Summary: Implicit Leave opcode generated breaks generated images.  Need workaround
 
 Compile the following sample and PEVerify it or check with monodis:
 the branch target of the break points outside the method (the solution is
 to add a ret at the end). I think this may be caused by the loop inversion
 code.
 
@@ -84,7 +84,23 @@
                 foreach (object a in list1) {
                         break;
                 }
         }
 }
 Spotted this bug in the mcs-compiled System.dll, too.
+
+
+------- Additional Comments From miguel@ximian.com  2002-07-09 15:23 -------
+Ok, for the latest comment, the bug was completely different.
+
+Turns out that `Break' was not aware that it could break out of a
+try/catch.  This is not allowed, and Break catches this error, but
+there is an implicit try/catch in a few other scenarios: using
+statements and foreach statements (break can only be used in Foreach
+though).
+
+So now Break is aware that it could be used in such a context, and
+uses Leave instead of Br.
+
+Sadly, I still have not fixed the bug with the implicit leave, I still
+do not know how to fix that.