We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The compiler accepts this:
// REQUIRED_ARGS: -preview=dip1000 int* f() @safe { int i = 3; auto x = &[&i][0]; // Should error, i is escaped into allocated memory return *x; }
Demonstration of memory corruption:
void main() { ubyte[64] buf; auto p = f(); writeln(*p); // 3 buf[] = 7; writeln(*p); // -326519080 }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The compiler accepts this:
Demonstration of memory corruption:
The text was updated successfully, but these errors were encountered: