Browse Source

* CodeExpressionCollection.cs: Fixed OutOfMemoryException when
passing collection to AddRange method on itself.
* CodeTypeReferenceCollection.cs: same.
* CodeParameterDeclarationExpressionCollection.cs: same.
* CodeStatementCollection.cs: same.

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

Gert Driesen 20 years ago
parent
commit
1add0ac303

+ 8 - 0
mcs/class/System/System.CodeDom/ChangeLog

@@ -1,3 +1,11 @@
+2005-11-08  Gert Driesen  <[email protected]>
+
+	* 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  <[email protected]>
 
 	* CodeEventReferenceExpression.cs: EventName now returns zero-length

+ 2 - 1
mcs/class/System/System.CodeDom/CodeExpressionCollection.cs

@@ -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]);
 			}
 		}

+ 2 - 1
mcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs

@@ -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]);
 			}
 		}

+ 2 - 1
mcs/class/System/System.CodeDom/CodeStatementCollection.cs

@@ -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]);
 			}
 		}

+ 2 - 1
mcs/class/System/System.CodeDom/CodeTypeReferenceCollection.cs

@@ -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]);
 			}
 		}