[Mono-bugs] [Bug 31541][Nor] New - compilation issue with labels and goto

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
1 Oct 2002 08:27:15 -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=31541

--- shadow/31541	Tue Oct  1 04:27:15 2002
+++ shadow/31541.tmp.7270	Tue Oct  1 04:27:15 2002
@@ -0,0 +1,42 @@
+Bug#: 31541
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: lupus@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: compilation issue with labels and goto
+
+mcs can't compile the following code.
+class T {
+                static int fib (int n) {
+                        int f0 = 0, f1 = 1, f2 = 0, i;
+
+                        if (n <= 1) goto L3;
+                        i = 2;
+                        L1:
+                        if (i <= n) goto L2;
+                        return f2;
+                        L2:
+                        f2 = f0 + f1;
+                        f0 = f1;
+                        f1 = f2;
+                        i++;
+                        goto L1;
+                        L3: 
+                        return n;
+                }
+ static void Main() {}
+}
+One of the labels ends up corrupted and mcs will get and exception when
+running on the ms runtime (on the mono runtime it produces an invalid
+program since the branch target will be out of the method code).