https://issues.dlang.org/show_bug.cgi?id=15585
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] Severity|normal |critical --- Comment #1 from [email protected] --- Actually, it *does* already cause a very visible, nasty problem: https://issues.dlang.org/show_bug.cgi?id=15586 Basically, by assuming that dchar can never have invalid values (no matter where the dchar came from), the compiler has basically turned all code containing `cast(dchar)` into undefined behaviour, because it will optimize out all character range checks (under its wrong assumption, none of the checks can ever fail, since dchar can't possibly have invalid values). This means string-vetting functions are basically turned to no-ops, and code that's supposed to throw exceptions or assert errors upon invalid dchar values will instead continue running wildly forward. This could mean that a function that's supposed to return something may actually return nothing, and the caller will get a garbage value instead (from whatever detritus is left in the return register when it was last modified). These problems are already showing up, even in non-release mode. I'm raising the severity of this bug. --
