I came across something similar.
The following program crashes on assert,
but only when compiled with -O
DMD64 D Compiler v2.068.0
----------------------------
struct SomeStruct
{
void fff (int n)
{
SomeStruct next;
assert (&next != &this);
if (n)
next.fff(n-1);
}
}
void main()
{
SomeStruct root;
root.fff(2);
}
----------------------------
As a workaround, add
return 3;
at the end of fff
and change void to int
Comment #6 by github-bugzilla — 2015-10-04T18:18:44Z