Comment #0 by dlang-bugzilla — 2020-05-08T00:11:17Z
//////////////// test.d ////////////////
struct V
{
bool alive = true;
void checkAlive() { assert(alive); }
}
struct S
{
V v;
@disable this(this);
~this() { v.alive = false; }
}
void main()
{
S().v.checkAlive();
}
////////////////////////////////////////
Works fine without -inline, assert trips with -inline.
This affects std.typecons.RefCounted. Because this bug causes it to return a dangling pointer into manually-allocated memory, it can cause memory corruption.
Comment #1 by dlang-bugzilla — 2020-05-08T00:19:05Z