[Mono-bugs] [Bug 24769] New - Array index lvalue incremented twice

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
15 May 2002 16:27:04 -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 dihlewis@yahoo.co.uk.

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

--- shadow/24769	Wed May 15 12:27:04 2002
+++ shadow/24769.tmp.24357	Wed May 15 12:27:04 2002
@@ -0,0 +1,38 @@
+Bug#: 24769
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: dihlewis@yahoo.co.uk               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Array index lvalue incremented twice
+
+The index expression i++ is evaluated twice to perform the increment on 
+the array element.
+
+
+
+using System;
+
+class Test {
+	public static int Main ()
+	{
+		int [] a = new int [2];
+		int i = 0;
+
+		++ a [i ++];
+		if (i != 1)
+			return 1;
+
+		return 0;
+	}
+}