[Mono-bugs] [Bug 60135][Blo] New - ArrayList.Insert(0, obj) causes endless loop

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 14 Jun 2004 04:09:37 -0400 (EDT)


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 reali@acm.org.

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

--- shadow/60135	2004-06-14 04:09:37.000000000 -0400
+++ shadow/60135.tmp.671	2004-06-14 04:09:37.000000000 -0400
@@ -0,0 +1,40 @@
+Bug#: 60135
+Product: Mono: Class Libraries
+Version: unspecified
+OS: SuSE 8.1
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: reali@acm.org               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: ArrayList.Insert(0, obj) causes endless loop
+
+The following code causes an endless loop in ArrayList. 
+
+The problem is in ArrayList.Shift: the internal array (_items) has length 
+0, thus the computation of the new length in a while loop (line 2820) with 
+length<<1 never ends.
+
+
+using System;
+using System.Collections;
+
+public class Test {
+
+
+    public static void Main(string[] args) {
+        ArrayList list = new ArrayList(new Object[0]);
+
+        list.Insert(0, "test");
+        Console.WriteLine("list-count:" + list.Count);
+    }
+
+
+}