https://issues.dlang.org/show_bug.cgi?id=23530
Issue ID: 23530 Summary: casting immutable away allowed in safe Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: critical Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: ajiesk...@gmail.com The following code compiles and runs without crash with DMD 2.100.2, flags -preview=dip1000: ------ @safe void main() { immutable int x = 5; //alternatively const auto a = &x; auto b = &cast() x; assert(a == b); //passes *b = 3; //undefined behaviour } ------ This is a major hole in memory safety, so I'm assigning severity to critical. --