[Mono-bugs] [Bug 58322][Nor] New - Compilation fails when mixing goto and exceptions

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 11 May 2004 09:00:39 -0400 (EDT)


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 alan.schmitt@polytechnique.org.

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

--- shadow/58322	2004-05-11 09:00:39.000000000 -0400
+++ shadow/58322.tmp.18522	2004-05-11 09:00:39.000000000 -0400
@@ -0,0 +1,84 @@
+Bug#: 58322
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: alan.schmitt@polytechnique.org               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Compilation fails when mixing goto and exceptions
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+
+Steps to reproduce the problem:
+1. Enter the following program (for instance, as test.cs):
+
+class Bug {
+
+  public static void Main () {
+    int x = 0;
+    int y = 0;
+    switch (0) {
+      default:{
+        switch (x) {
+          case 0:{
+            switch (y) {
+              case 0:{
+                goto k_0;
+              }
+              default:{
+                throw new System.SystemException("unexpected fall-through
+in switch");
+              }
+            }
+          }
+          default:{
+            break;
+          }
+        }
+      }
+      k_0:{
+        break;
+      }
+    }
+  }
+} 
+
+2. compile it (mcs test.cs)
+
+Actual Results:
+
+The compiler returns an error:
+
+schmitta@charm mono_bug % mcs test.cs
+bug.cs(8) error CS0163: Control cannot fall through from one case label to
+another
+Compilation failed: 1 error(s), 0 warnings
+
+Expected Results:
+
+Compilation should succeed, as there is no fall through.
+
+How often does this happen? 
+
+All the time.
+
+Additional Information:
+
+Replacing the "throw" by a "goto k_0", or replacing the "goto k_0" by a
+"throw" does not show the problem. One must use both to have the problem.
+
+I'm using:
+schmitta@charm mono_bug % mcs --version
+Mono C# compiler version 0.91.0.0