[Issue 21044] [CTFE] Infinite loop in ForStatement::interpret

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 13 08:57:55 UTC 2020


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

Iain Buclaw <ibuclaw at gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw at gdcproject.org

--- Comment #1 from Iain Buclaw <ibuclaw at gdcproject.org> ---
Reduction is indeed close to what I anticipated.

---
@property empty(T)(T a)
{
    return !a;
}

auto cmp(R1, R2)(R1 , R2 r2)
{
    for (;;)
        if (r2.empty) return int();
}

auto caseEnclose()
{
    unicode.LC;
}

struct unicode
{
    auto opDispatch(string name)()     {
        static if (cmp(name, ""))
            return ;
    }
}
---

In the original, there would have been a popFront() call, but I suspect that
the body of popFront was removed during reduction.

--


More information about the Digitalmars-d-bugs mailing list