changeset 1471:44d9b47ed060

[Issue 929] Resizing array of associative arrays (uint[char[]][]) causes infinite loop / hang Nick Atamas <nick.atamas@gmail.com> 2007-02-04 http://d.puremagic.com/issues/show_bug.cgi?id=929
author thomask
date Thu, 05 Apr 2007 16:36:20 +0000
parents 86c8a8d4694b
children 22767ec83a24
files run/l/length_10_A.d run/l/length_10_B.d run/l/length_11_A.d run/l/length_11_B.d
diffstat 4 files changed, 65 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/run/l/length_10_A.d	Thu Apr 05 16:35:45 2007 +0000
+++ b/run/l/length_10_A.d	Thu Apr 05 16:36:20 2007 +0000
@@ -2,17 +2,23 @@
 // $Date$
 // $Author$
 
-// @author@	Nick Atamas <nick.atamas@gmail.com>
-// @date@	2007-02-04
-// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=929
-// @desc@	[Issue 929] Resizing array of associative arrays (uint[char[]][]) causes infinite loop / hang
+// @author@	<CppCoder@gmail.com>
+// @date@	2006-05-02
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=123
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1031
 
 module dstress.run.l.length_10_A;
 
+size_t intRes(){
+	return 4;
+}
+
+static const char[] foo = "abc123";
+
 int main(){
-	uint[char[]][] fractal;
-	fractal.length = 10;
-	if(10 != fractal.length){
+	char c = foo[intRes() % $];
+
+	if(c != '2'){
 		assert(0);
 	}
 
--- a/run/l/length_10_B.d	Thu Apr 05 16:35:45 2007 +0000
+++ b/run/l/length_10_B.d	Thu Apr 05 16:36:20 2007 +0000
@@ -2,16 +2,23 @@
 // $Date$
 // $Author$
 
-// @author@	Nick Atamas <nick.atamas@gmail.com>
-// @date@	2007-02-04
-// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=929
-// @desc@	[Issue 929] Resizing array of associative arrays (uint[char[]][]) causes infinite loop / hang
+// @author@	<CppCoder@gmail.com>
+// @date@	2006-05-02
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=123
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1031
 
 module dstress.run.l.length_10_B;
 
+size_t intRes(){
+	return 4;
+}
+
+const char[] foo = "abc123";
+
 int main(){
-	uint[char[]][10] fractal;
-	if(10 != fractal.length){
+	char c = foo[intRes() % $];
+
+	if(c != '2'){
 		assert(0);
 	}
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/l/length_11_A.d	Thu Apr 05 16:36:20 2007 +0000
@@ -0,0 +1,20 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Nick Atamas <nick.atamas@gmail.com>
+// @date@	2007-02-04
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=929
+// @desc@	[Issue 929] Resizing array of associative arrays (uint[char[]][]) causes infinite loop / hang
+
+module dstress.run.l.length_11_A;
+
+int main(){
+	uint[char[]][] fractal;
+	fractal.length = 10;
+	if(10 != fractal.length){
+		assert(0);
+	}
+
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/l/length_11_B.d	Thu Apr 05 16:36:20 2007 +0000
@@ -0,0 +1,19 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Nick Atamas <nick.atamas@gmail.com>
+// @date@	2007-02-04
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=929
+// @desc@	[Issue 929] Resizing array of associative arrays (uint[char[]][]) causes infinite loop / hang
+
+module dstress.run.l.length_11_B;
+
+int main(){
+	uint[char[]][10] fractal;
+	if(10 != fractal.length){
+		assert(0);
+	}
+
+	return 0;
+}