[Mono-bugs] [Bug 43660][Maj] New - Compilation of nested switch statements with goto seems wrong
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Mon, 26 May 2003 05:18:00 -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 sestoft@dina.kvl.dk.
http://bugzilla.ximian.com/show_bug.cgi?id=43660
--- shadow/43660 Mon May 26 05:18:00 2003
+++ shadow/43660.tmp.15479 Mon May 26 05:18:00 2003
@@ -0,0 +1,63 @@
+Bug#: 43660
+Product: Mono/MCS
+Version: unspecified
+OS: Debian Woody
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Major
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: sestoft@dina.kvl.dk
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Compilation of nested switch statements with goto seems wrong
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+Compilation of nested switch statements is wrong, and can cause mcs to
+throw a NullReferenceException
+
+Steps to reproduce the problem:
+1. Compile this program:
+
+using System;
+
+class MyTest {
+ public static void Main(String[] args) {
+ switch (1) {
+ case 1:
+ switch (2) {
+ case 2: goto case 1;
+ }
+ }
+ }
+}
+
+
+Actual Results:
+
+case-bug.cs(10) error CS0159: No such label 'case 1': for the goto case
+
+Unhandled Exception: System.NullReferenceException: A null value was found
+where an object instance was required
+
+
+Expected Results:
+
+The error message is OK, but the Unhandled Exception is not.
+
+How often does this happen?
+
+Always.
+
+Additional Information:
+
+I suspect that the compilation of nested switch statements is actually
+wrong, because changing the goto case 1 to goto case 2 produces a
+spurious message about falling through...