* CodeExpressionCollection.cs: Fixed OutOfMemoryException when
authorGert Driesen <drieseng@users.sourceforge.net>
Tue, 8 Nov 2005 19:49:26 +0000 (19:49 -0000)
committerGert Driesen <drieseng@users.sourceforge.net>
Tue, 8 Nov 2005 19:49:26 +0000 (19:49 -0000)
passing collection to AddRange method on itself.
* CodeTypeReferenceCollection.cs: same.
* CodeParameterDeclarationExpressionCollection.cs: same.
* CodeStatementCollection.cs: same.

svn path=/trunk/mcs/; revision=52725

mcs/class/System/System.CodeDom/ChangeLog
mcs/class/System/System.CodeDom/CodeExpressionCollection.cs
mcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs
mcs/class/System/System.CodeDom/CodeStatementCollection.cs
mcs/class/System/System.CodeDom/CodeTypeReferenceCollection.cs

index cf52f2b6161c64b90fa8420e718d94afc71267ad..3317bf4a1b2333691744f780976f7863af63555c 100644 (file)
@@ -1,3 +1,11 @@
+2005-11-08  Gert Driesen  <drieseng@users.sourceforge.net>
+
+       * CodeExpressionCollection.cs: Fixed OutOfMemoryException when
+       passing collection to AddRange method on itself.
+       * CodeTypeReferenceCollection.cs: same.
+       * CodeParameterDeclarationExpressionCollection.cs: same.
+       * CodeStatementCollection.cs: same.
+
 2005-11-04  Gert Driesen  <drieseng@users.sourceforge.net>
 
        * CodeEventReferenceExpression.cs: EventName now returns zero-length
index 9a03cebe0cc0c2f5e34001d295ea51e281236e94..e79609b924c7f95f511f3c52af911769bee03c82 100644 (file)
@@ -94,7 +94,8 @@ namespace System.CodeDom
                                throw new ArgumentNullException ("value");
                        }
 
-                       for (int i = 0; i < value.Count; i++) {
+                       int count = value.Count;
+                       for (int i = 0; i < count; i++) {
                                Add (value[i]);
                        }
                }
index 36f109e13dd21a3dc84b7c172d5966b912860208..2135ebbb68460f23ed9e3013c69764f1d5b43145 100644 (file)
@@ -94,7 +94,8 @@ namespace System.CodeDom
                                throw new ArgumentNullException ("value");
                        }
 
-                       for (int i = 0; i < value.Count; i++) {
+                       int count = value.Count;
+                       for (int i = 0; i < count; i++) {
                                Add (value[i]);
                        }
                }
index f08df1b1e3b7d86fc7cc3eaf2bff0d09439591b6..11a41280641c9003b9ed6d3f4ab97eaee6abac24 100644 (file)
@@ -99,7 +99,8 @@ namespace System.CodeDom
                                throw new ArgumentNullException ("value");
                        }
 
-                       for (int i = 0; i < value.Count; i++) {
+                       int count = value.Count;
+                       for (int i = 0; i < count; i++) {
                                Add (value[i]);
                        }
                }
index dc14aa714ee8244b0e03510cb95fbfd3550687e3..5551a5b0cb4d1c1b52a98f694b64990a1aac51bd 100644 (file)
@@ -103,7 +103,8 @@ namespace System.CodeDom
                                throw new ArgumentNullException ("value");
                        }
 
-                       for (int i = 0; i < value.Count; i++) {
+                       int count = value.Count;
+                       for (int i = 0; i < count; i++) {
                                Add (value[i]);
                        }
                }