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

--- Comment #3 from Walter Bright <[email protected]> ---
A somewhat more illustrative test:


struct SpinLock
{
    align(64)
        int x;
}

void collectReferences(int x) //ref HashTab references)
{
    SpinLock lock = SpinLock(8); // dmd BUG: alignment causes bad capture!

    void mark() scope nothrow
    {
        assert(lock.x == 8);
        assert(x == 7);
    }

    mark();
}

void main()
{
    collectReferences(7);
}

--

Reply via email to