diff dmd/ArrayInitializer.d @ 191:52188e7e3fb5

Fixed deprecated features, now compiles with DMD2.058 Also changed Array allocation policy: Now doesn't reallocate but malloc's, followed by a memcpy (no free). (this fixes a crash while compiling druntime. Same bug in dmd)
author korDen@korDen-pc
date Sun, 25 Mar 2012 03:11:12 +0400
parents b0d41ff5e0df
children
line wrap: on
line diff
--- a/dmd/ArrayInitializer.d	Sun Mar 25 01:39:46 2012 +0400
+++ b/dmd/ArrayInitializer.d	Sun Mar 25 03:11:12 2012 +0400
@@ -328,7 +328,7 @@
 
 		scope dts = new Vector!(dt_t*)();
 		uint size;
-		uint length;
+		uint length_;
 		uint i;
 		dt_t* dt;
 		dt_t* d;
@@ -340,7 +340,7 @@
 
 		size = cast(uint)tn.size();
 
-		length = 0;
+		length_ = 0;
 		for (i = 0; i < index.dim; i++)
 		{
 			Expression idx;
@@ -348,16 +348,16 @@
 
 			idx = index[i];
 			if (idx)
-				length = cast(uint)idx.toInteger();
-			//printf("\tindex[%d] = %p, length = %u, dim = %u\n", i, idx, length, dim);
+				length_ = cast(uint)idx.toInteger();
+			//printf("\tindex[%d] = %p, length_ = %u, dim = %u\n", i, idx, length_, dim);
 
-			assert(length < dim);
+			assert(length_ < dim);
 			val = value[i];
 			dt = val.toDt();
-			if (dts[length])
-				error(loc, "duplicate initializations for index %d", length);
-			dts[length] = dt;
-			length++;
+			if (dts[length_])
+				error(loc, "duplicate initializations for index %d", length_);
+			dts[length_] = dt;
+			length_++;
 		}
 
 		Expression edefault = tb.nextOf().defaultInit(Loc(0));