[Issue 18026] Stack overflow in ddmd/dtemplate.d:6241, TemplateInstance::needsCodegen()

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 28 11:38:37 UTC 2021


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

Tim <tim.dlang at t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tim.dlang at t-online.de

--- Comment #20 from Tim <tim.dlang at t-online.de> ---
I have also seen a stack overflow with TemplateInstance.needsCodegen and
reduced it to the following code:

bool f(T)(T x)
{
    return false;
}

static foreach(i; 0..60000)
{
    static if(f(i))
    {
    }
}

The failure happens on Windows. It can also be reproduced on Linux by
increasing the number of iterations or reducing the stack size first with the
command "ulimit -s 1024"

--


More information about the Digitalmars-d-bugs mailing list