[Mono-bugs] [Bug 81601][Blo] New - switch with goto case/default gives wrong IL when condition is literal

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri May 11 14:12:23 EDT 2007


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 ujihara at aurora.dti.ne.jp.

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

--- shadow/81601	2007-05-11 14:12:23.000000000 -0400
+++ shadow/81601.tmp.3469	2007-05-11 14:12:23.000000000 -0400
@@ -0,0 +1,52 @@
+Bug#: 81601
+Product: Mono: Compilers
+Version: 1.2
+OS: Windows XP
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: ujihara at aurora.dti.ne.jp               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: switch with goto case/default gives wrong IL when condition is literal  
+
+Description of Problem:
+'switch' statement including 'goto case' or 'goto default' statement 
+gives wrong IL when the switch's condition is literal. 
+
+Steps to reproduce the problem:
+
+1. Compile and execute the following program.
+public class A {
+ public static void Main(string[] arg) {
+  switch (10) {
+   case 10:
+    System.Console.Out.WriteLine(10);
+    goto default;
+   default:
+    System.Console.Out.WriteLine("default");
+    break;
+  }
+ }
+}
+ 
+Actual Results:
+Unhandled Exception: System.InvalidProgramException: Invalid IL code in 
+A:Main (string[]): IL_000c: br        IL_ffffffff
+
+Expected Results:
+10
+default
+
+How often does this happen? 
+
+Always
+
+Additional Information:
+It also happens when we change 'goto default' into 'goto case 10'.


More information about the mono-bugs mailing list