https://issues.dlang.org/show_bug.cgi?id=20949
Issue ID: 20949
Summary: std.range.popFront is unsafe in release mode
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: [email protected]
Reporter: [email protected]
Compile with `-release`:
----
import std.range.primitives: popFront;
import std.stdio: writeln;
void main() @safe
{
char[3] a = "foo";
int x = 42;
char[] b = a[0 .. 0];
b.popFront();
b[3] = 13; /* Writes over x. */
writeln(x); /* Prints "13". */
}
----
--