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

--- Comment #2 from Walter Bright <bugzi...@digitalmars.com> ---
A further reduction:

struct Vector {
    this(ubyte a) {
        pragma(inline, false);
        buf = a;
    }

    ~this() {
        pragma(inline, false);
        buf = 0;
    }

    ubyte buf;
}

void bar(ubyte* v) {
    pragma(inline, true);
    assert(*v == 1);
}

void main() {
    bar(&Vector(1).buf);
}

It's the inlining of bar() that elicits the bug.

--

Reply via email to