[Mono-bugs] [Bug 30001][Maj] New - Break statement within a for ( ;; ) loop does not exit from the loop

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
7 Sep 2002 06:47:16 -0000


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

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

--- shadow/30001	Sat Sep  7 02:47:16 2002
+++ shadow/30001.tmp.7165	Sat Sep  7 02:47:16 2002
@@ -0,0 +1,59 @@
+Bug#: 30001
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: murban@mylinuxisp.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Break statement within a for ( ;; ) loop does not exit from the loop
+
+Description of Problem:  
+  
+In a 'for' loop with none of the optional clauses, a break statement does  
+not cause an exit from the loop. The loop continues indefinitely.  
+  
+Steps to reproduce the problem:  
+1. Run the program below:  
+  
+public class Testing 
+{ 
+	public static void Main() 
+	{ 
+		int x = 4; 
+		 
+		for ( ;; ) 
+		{ 
+			if ( x == 4 ) 
+				break; 
+		} 
+	}	 
+}  
+  
+Actual Results:  
+  
+Endless loop 
+ 
+ 
+Expected Results:  
+  
+Program terminates normally 
+ 
+  
+How often does this happen?   
+  
+Always 
+ 
+ 
+Additional Information:  
+ 
+Replacing 'for ( ;; )' with 'while (true)' does *not* exhibit any 
+problems.