# HG changeset patch # User thomask # Date 1175790980 0 # Node ID 44d9b47ed0602113a12d4f66ebb224336f0d8cb7 # Parent 86c8a8d4694b5035f9cc4fda9e7633ef4334650c [Issue 929] Resizing array of associative arrays (uint[char[]][]) causes infinite loop / hang Nick Atamas 2007-02-04 http://d.puremagic.com/issues/show_bug.cgi?id=929 diff -r 86c8a8d4694b -r 44d9b47ed060 run/l/length_10_A.d --- 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 -// @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@ +// @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); } diff -r 86c8a8d4694b -r 44d9b47ed060 run/l/length_10_B.d --- 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 -// @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@ +// @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); } diff -r 86c8a8d4694b -r 44d9b47ed060 run/l/length_11_A.d --- /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 +// @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; +} diff -r 86c8a8d4694b -r 44d9b47ed060 run/l/length_11_B.d --- /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 +// @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; +}