www.digitalmars.com         C & C++   DMDScript  

D - [Bug] DMD Crash

reply Patrick Down <Patrick_member pathlink.com> writes:
The following crashes dmd.

Object function(int node) ObjectFactory;

private ObjectFactory[char[]] factoryTable;


template RegisterClassFactory(T : Object)
{
void RegisterClassFactory()
{
factoryTable[T.classinfo.name] = T.Factory;
}
}


class Foo
{
public // Interface
{
this(char[] text)
{
}
}

static Foo Factory(int root)
{
}
}


static this()
{
RegisterClassFactory!(Foo)();
}
Jan 28 2004
parent reply Patrick Down <Patrick_member pathlink.com> writes:
Actually this is easier to reproduce.  This crashes
dmd:

Object function(int node) ObjectFactory;

private ObjectFactory[char[]] factoryTable;


In article <bv9tra$2p5j$1 digitaldaemon.com>, Patrick Down says...
The following crashes dmd.

Object function(int node) ObjectFactory;

private ObjectFactory[char[]] factoryTable;


template RegisterClassFactory(T : Object)
{
void RegisterClassFactory()
{
factoryTable[T.classinfo.name] = T.Factory;
}
}


class Foo
{
public // Interface
{
this(char[] text)
{
}
}

static Foo Factory(int root)
{
}
}


static this()
{
RegisterClassFactory!(Foo)();
}

Jan 29 2004
parent reply Burton Radons <loth users.sourceforge.net> writes:
Patrick Down wrote:

 Actually this is easier to reproduce.  This crashes
 dmd:
 
 Object function(int node) ObjectFactory;
 
 private ObjectFactory[char[]] factoryTable;

alias Object function(int node) ObjectFactory; private ObjectFactory[char[]] factoryTable; or Object function(int node) ObjectFactory; private typeof(ObjectFactory)[char[]] factoryTable; Obviously it shouldn't crash in any case, but you give no indication whether you realised you were supplying bad code.
Jan 30 2004
parent Patrick Down <Patrick_member pathlink.com> writes:
In article <bvejtl$1gui$1 digitaldaemon.com>, Burton Radons says...
Patrick Down wrote:

 Actually this is easier to reproduce.  This crashes
 dmd:
 
 Object function(int node) ObjectFactory;
 
 private ObjectFactory[char[]] factoryTable;

alias Object function(int node) ObjectFactory; private ObjectFactory[char[]] factoryTable; or Object function(int node) ObjectFactory; private typeof(ObjectFactory)[char[]] factoryTable; Obviously it shouldn't crash in any case, but you give no indication whether you realised you were supplying bad code.

Thanks. I had already figured it out but it's good of you to point out my error.
Jan 30 2004