union/toString: crash/segfault: What's happening here?

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Jan 12 20:20:33 UTC 2018


On Fri, Jan 12, 2018 at 10:49:45AM -0800, H. S. Teoh via Digitalmars-d-learn wrote:
> On Fri, Jan 12, 2018 at 11:09:47AM +0000, kdevel via Digitalmars-d-learn wrote:
> [...]
[...]
> > https://issues.dlang.org/show_bug.cgi?id=18232
> 
> Yep, definitely a codegen bug.  Apparently, local variables in union
> member functions aren't initialized to .init as they should be.
[...]

Fix: https://github.com/dlang/dmd/pull/7687

Temporary workaround: explicitly initialize your local variables in
union member functions.


T

-- 
Life begins when you can spend your spare time programming instead of watching television. -- Cal Keegan


More information about the Digitalmars-d-learn mailing list