[Issue 19968] @safe code can create invalid bools resulting in memory corruption

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jun 15 13:39:53 UTC 2019


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

--- Comment #4 from ag0aep6g <ag0aep6g at gmail.com> ---
(In reply to timon.gehr from comment #3)
> Also, the spec currently states:
> 
> "Undefined Behavior: If a void initialized variable's value is used before
> it is set, the behavior is undefined."
> 
> https://dlang.org/spec/declaration.html#void_init
> 
> Unless this is changed (and I don't see a compelling reason to), there can't
> be _any_ `void` initialization in @safe code.

That's issue 18016, and Walter has an open PR to resolve it by changing the
spec: <https://github.com/dlang/dlang.org/pull/2260>.

--


More information about the Digitalmars-d-bugs mailing list