Thread overview
[Bug] DMD Crash
Jan 29, 2004
Patrick Down
Jan 30, 2004
Patrick Down
Jan 30, 2004
Burton Radons
Jan 30, 2004
Patrick Down
January 29, 2004
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)();
}


January 30, 2004
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)();
>}
>
>


January 30, 2004
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.

January 30, 2004
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.