# HG changeset patch # User thomask # Date 1175329498 0 # Node ID e489e020a55de549eb6a550eaeb9e4b85a46aeb1 # Parent a44492981ddb644baeb630685e7205073f511268 r7385@birke: tk | 2007-03-29 15:34:13 +0200 [Issue 1058] DMD hangs with 100% CPU - member function returning forward-referenced struct before constructor 2007-03-12 http://d.puremagic.com/issues/show_bug.cgi?id=1058 diff -r a44492981ddb -r e489e020a55d run/f/forward_reference_19_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/f/forward_reference_19_A.d Sat Mar 31 08:24:58 2007 +0000 @@ -0,0 +1,34 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ +// @date@ 2007-03-12 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1058 +// @desc@ [Issue 1058] DMD hangs with 100% CPU - member function returning forward-referenced struct before constructor + +module dstress.run.f.forward_reference_19_A; + +class A{ + B x; + + B b(){ + return x; + } +} + +struct B{ + int dummy; +} + +int main(){ + A a = new A(); + B b; + b.dummy = 0x12EF34AB; + a.x = b; + if(0x12EF34AB != a.b().dummy){ + assert(0); + } + + return 0; +} diff -r a44492981ddb -r e489e020a55d run/f/forward_reference_19_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/f/forward_reference_19_B.d Sat Mar 31 08:24:58 2007 +0000 @@ -0,0 +1,37 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ +// @date@ 2007-03-12 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1058 +// @desc@ [Issue 1058] DMD hangs with 100% CPU - member function returning forward-referenced struct before constructor + +module dstress.run.f.forward_reference_19_B; + +class A{ + B x; + + B b(){ + return x; + } + + this(){ + } +} + +struct B{ + int dummy; +} + +int main(){ + A a = new A(); + B b; + b.dummy = 0x12EF34AB; + a.x = b; + if(0x12EF34AB != a.b().dummy){ + assert(0); + } + + return 0; +} diff -r a44492981ddb -r e489e020a55d run/f/forward_reference_19_C.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/f/forward_reference_19_C.d Sat Mar 31 08:24:58 2007 +0000 @@ -0,0 +1,37 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ +// @date@ 2007-03-12 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1058 +// @desc@ [Issue 1058] DMD hangs with 100% CPU - member function returning forward-referenced struct before constructor + +module dstress.run.f.forward_reference_19_C; + +class A{ + B x; + + this(){ + } + + B b(){ + return x; + } +} + +struct B{ + int dummy; +} + +int main(){ + A a = new A(); + B b; + b.dummy = 0x12EF34AB; + a.x = b; + if(0x12EF34AB != a.b().dummy){ + assert(0); + } + + return 0; +} diff -r a44492981ddb -r e489e020a55d run/f/forward_reference_19_D.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/f/forward_reference_19_D.d Sat Mar 31 08:24:58 2007 +0000 @@ -0,0 +1,37 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ +// @date@ 2007-03-12 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1058 +// @desc@ [Issue 1058] DMD hangs with 100% CPU - member function returning forward-referenced struct before constructor + +module dstress.run.f.forward_reference_19_D; + +struct B{ + int dummy; +} + +class A{ + B x; + + this(){ + } + + B b(){ + return x; + } +} + +int main(){ + A a = new A(); + B b; + b.dummy = 0x12EF34AB; + a.x = b; + if(0x12EF34AB != a.b().dummy){ + assert(0); + } + + return 0; +} diff -r a44492981ddb -r e489e020a55d run/f/forward_reference_19_E.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/f/forward_reference_19_E.d Sat Mar 31 08:24:58 2007 +0000 @@ -0,0 +1,37 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ +// @date@ 2007-03-12 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1058 +// @desc@ [Issue 1058] DMD hangs with 100% CPU - member function returning forward-referenced struct before constructor + +module dstress.run.f.forward_reference_19_E; + +struct B{ + int dummy; +} + +class A{ + B x; + + B b(){ + return x; + } + + this(){ + } +} + +int main(){ + A a = new A(); + B b; + b.dummy = 0x12EF34AB; + a.x = b; + if(0x12EF34AB != a.b().dummy){ + assert(0); + } + + return 0; +}