[Mono-bugs] [Bug 37708][Maj] New - mcs miscompiles break statement

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Fri, 7 Feb 2003 01:47:19 -0500 (EST)


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 mathpup@mylinuxisp.com.

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

--- shadow/37708	Fri Feb  7 01:47:19 2003
+++ shadow/37708.tmp.1107	Fri Feb  7 01:47:19 2003
@@ -0,0 +1,62 @@
+Bug#: 37708
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: mathpup@mylinuxisp.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs miscompiles break statement
+
+Description of Problem: 
+ 
+In the method 
+ 
+	public static int Method(int x) 
+	{ 
+		for ( ;; ) 
+		{ 
+			if ( x != 1 ) 
+				x--; 
+			else 
+			 	break; 
+			return 5; 
+		} 
+		return 0; 
+	} 
+ 
+mcs miscompiles one of the statements so that the break statement does not exit 
+from the for-loop. mcs also generates a warning that the "return 0;" statement is 
+unreachable -- which is consistent with mcs's incorrect compilation. csc does 
+correctly compile the program. 
+ 
+ 
+Steps to reproduce the problem: 
+1. mcs assign.cs 
+2. mono assign.exe 
+ 
+ 
+Actual Results: 
+ 
+Endless loop with no output 
+ 
+ 
+Expected Results: 
+ 
+Prints "0" on the console. 
+ 
+ 
+How often does this happen?  
+ 
+Always 
+ 
+ 
+Additional Information: