[Mono-bugs] [Bug 75255][Maj] New - spurious unreachability warning with GOTO

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Jun 13 15:45:05 EDT 2005


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 vgapeyev at cis.upenn.edu.

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

--- shadow/75255	2005-06-13 15:45:05.000000000 -0400
+++ shadow/75255.tmp.24774	2005-06-13 15:45:05.000000000 -0400
@@ -0,0 +1,52 @@
+Bug#: 75255
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Major
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: vgapeyev at cis.upenn.edu               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: spurious unreachability warning with GOTO 
+
+This was tested on the current SVN (r45871) version of mono.
+
+Description of Problem:
+
+C# compiler generates a spurious unreachability warning when GOTO is
+involved.  (Apparently, this happens when the target label of the GOTO
+is not otherwise reachable in the code.)
+
+
+Steps to reproduce the problem:
+
+   Compile and run the following: 
+
+class Test  {
+    public static void Main (string[] args) {
+       goto lbl;
+       lbl:  System.Console.WriteLine("Executing at the label");
+    }
+}
+
+
+Actual Results:
+
+% mcs bug.cs                       
+bug.cs(2) warning CS0162: Unreachable code detected
+Compilation succeeded - 1 warning(s)
+% mono bug.exe                     
+Executing at the label
+
+
+Expected Results:
+
+No warning should occur. (The execution is correct, i.e. the
+"unreachable" code is being reached.)


More information about the mono-bugs mailing list