D - [Bug] DMD Crash
- Patrick Down <Patrick_member pathlink.com> Jan 28 2004
- Patrick Down <Patrick_member pathlink.com> Jan 29 2004
- Burton Radons <loth users.sourceforge.net> Jan 30 2004
- Patrick Down <Patrick_member pathlink.com> Jan 30 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)();
}
Jan 28 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)(); }
Jan 29 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.
Jan 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.
Jan 30 2004








Patrick Down <Patrick_member pathlink.com>