[Mono-bugs] [Bug 31541][Nor] Changed - compilation issue with labels and goto
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
3 Oct 2002 04:11: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 miguel@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=31541
--- shadow/31541 Tue Oct 1 04:27:15 2002
+++ shadow/31541.tmp.17895 Thu Oct 3 00:11:15 2002
@@ -2,16 +2,16 @@
Product: Mono/MCS
Version: unspecified
OS: other
OS Details:
Status: NEW
Resolution:
-Severity:
+Severity: Unknown
Priority: Normal
Component: Misc
-AssignedTo: mono-bugs@ximian.com
+AssignedTo: martin@gnome.org
ReportedBy: lupus@ximian.com
QAContact: mono-bugs@ximian.com
TargetMilestone: ---
URL:
Cc:
Summary: compilation issue with labels and goto
@@ -37,6 +37,33 @@
}
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).
+
+------- Additional Comments From miguel@ximian.com 2002-10-03 00:11 -------
+I have a smaller test case. This seems to be related to some form
+of flow analysis, if you remove the "return" from the code, then
+the code is properly generated.
+
+Basically what happens is that we are not calling the Emit method
+for the LabeledStatement whose label is L2, only L1 and L3 are being
+called, so the Label in the Labeled statement contains an undefined
+value.
+
+Martin, could you please look at this?
+
+class T {
+ static int xx (int n) {
+ if (n <= 1) goto L3;
+ L1:
+ if (1 <= n) goto L2;
+ return n;
+ L2:
+ goto L1;
+ L3:
+ return n;
+ }
+ static void Main() {}
+}
+