[Mono-bugs] [Bug 50968][Wis] New - Array.Clear does not work on non-zero-bounded arrays

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 13 Nov 2003 22:45:17 -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 bmaurer@users.sf.net.

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

--- shadow/50968	2003-11-13 22:45:17.000000000 -0500
+++ shadow/50968.tmp.6075	2003-11-13 22:45:17.000000000 -0500
@@ -0,0 +1,82 @@
+Bug#: 50968
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: bmaurer@users.sf.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Array.Clear does not work on non-zero-bounded arrays
+
+Description of Problem:
+Array.Clear does not work on non-zero-bounded arrays
+
+Steps to reproduce the problem:
+using System;
+
+class Foo {
+	static void Main ()
+	{
+		Array foo = Array.CreateInstance (typeof (int), new int [] { 12 }, new
+int [] { 1 });
+		
+		Console.WriteLine ("LOWER : " + foo.GetLowerBound (0));
+		Console.WriteLine ("LENGTH : " + foo.GetLength (0));
+
+		for (int i = foo.GetLowerBound (0); i < foo.GetLowerBound (0) +
+foo.GetLength (0); i++)
+			foo.SetValue (i, i);
+
+		Array.Clear (foo, foo.GetLowerBound (0), foo.GetLength (0));
+		
+		for (int i = foo.GetLowerBound (0); i < foo.GetLowerBound (0) +
+foo.GetLength (0); i++)
+			Console.WriteLine (foo.GetValue (i));
+	}
+}
+
+Actual Results:
+[benm@Ben tmp]$ mcs t.cs; mono t.exe
+Compilation succeeded
+LOWER : 1
+LENGTH : 12
+1
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+
+
+Expected Results:
+C:\test>t
+LOWER : 1
+LENGTH : 12
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+
+Note the "1" in mono, this value is *not* cleared.