[Issue 19661] DMD 2.084.0 SIGSEGV in std.traits.isFunction

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 18 18:02:55 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=19661

--- Comment #3 from Basile-z <b2.temp at gmx.com> ---
There's a recursive template instantiation in dmd.dmangle, in function 

  void mangleTemplateInstance(TemplateInstance ti) 

which is possible to detect with the ti.inuse variable. Then you ends up with
an assert(0):

> dmd/todt.d:69 void dmd.todt.Initializer_toDt(dmd.init.Initializer, ref dmd.backend.dt.DtBuilder).visitError(dmd.init.ErrorInitializer) [0x6d3736]
> dmd/todt.d:204 _Z16Initializer_toDtP11InitializerR9DtBuilder [0x6d36a5]
> dmd/toobj.d:874 _ZN9toObjFile9ToObjFile15initializerToDtEP14VarDeclarationR9DtBuilder [0x6e13aa]
> dmd/toobj.d:608 _ZN9toObjFile9ToObjFile5visitEP14VarDeclaration [0x6e0a74]
> dmd/declaration.d:1642 _ZN14VarDeclaration6acceptEP7Visitor [0x58243d]
> dmd/toobj.d:1020 _Z9toObjFileP7Dsymbolb [0x6dffbe]
> dmd/glue.d:409 _Z10genObjFileP6Moduleb [0x6d0b13]
> dmd/mars.d:717 int dmd.mars.tryMain(ulong, const(char)**, ref dmd.globals.Param) [0x65d5ea]
> dmd/mars.d:925 _Dmain [0x65e339]

If you remove it finally a bad error message happens (the default one for
ErrorExp). So that's not ideal.

> Error: unknown, please file report on issues.dlang.org
> ice19661.d(11,18): Error: template instance `std.traits.isFunction!(testModule)` recursive template instantiation : isFunction!(testModule)
> Error: invalid initializer

There should just be the error related to recursion.

--


More information about the Digitalmars-d-bugs mailing list