[Issue 23181] [REG 2.099] AssertError at src/dmd/e2ir.d(6094): Trying reference _d_arraysetctor
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jun 13 15:23:59 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23181
Iain Buclaw <ibuclaw at gdcproject.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ibuclaw at gdcproject.org
--- Comment #1 from Iain Buclaw <ibuclaw at gdcproject.org> ---
In the release binaries of dmd, you can see that there is a run-time regression
as well.
---
void main()
{
struct hasDtor
{
import core.stdc.stdio;
int count;
~this() { printf("dtor(%d)\n", count); }
}
hasDtor[4] arr4 = hasDtor(4);
}
---
dtor(1)
dtor(37)
dtor(0)
dtor(0)
dtor(4)
dtor(4)
dtor(4)
dtor(4)
---
Because the codegen is calling _d_arraysetassign, the destructor is being ran
on the uninitialized array.
--
More information about the Digitalmars-d-bugs
mailing list