[Issue 1512] GC infinite loop when invalid user code runs.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 19 00:10:08 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1512





------- Comment #5 from davidl at 126.com  2007-09-19 02:10 -------
it's related to the compiling command of phobos
when DFLAGS in src\phobos\win32.mak contains -O this bug is triggered. 

with non optimized phobos, the following code on DMD 1.021 behaves correctly
with printing : "exception caught"

class weirdclass
{
        void func()
        {
                delete this;
        }
}

void main()
{
        auto inst=new weirdclass;
        inst.func;
                try
                {
                delete inst;   // GC loops here
                }
                catch(Object o)
                {
                        printf("exception caught");     
                }
}


-- 



More information about the Digitalmars-d-bugs mailing list