On Tuesday, 23 January 2018 at 02:25:57 UTC, Mike Franklin wrote:
Due to the aforementioned bugs in my prior posts, I couldn't
even make an example to demonstrate in @safe code, so I
modified the example slightly in an effort to reproduce the
same problem.
import std.stdio;
void main() @safe
{
string foo = "foo";
string* ls0;
string* p1, p2;
ls0 = &foo;
p1 = ls0;
ls0.destroy();
p2 = ls0;
writeln(p2.length);
}
Error: program killed by signal 11
https://run.dlang.io/is/ecYAKZ
Gah!!! I screwed up that example, and I can't edit the post. See
the example here:
import std.stdio;
void main() @safe
{
string foo = "foo";
string* ls0;
string* p1, p2;
ls0 = &foo;
p1 = ls0;
ls0.destroy();
p2 = ls0;
writeln(p2.length);
}
Compile with `-dip1000`
Error: program killed by signal 11
https://run.dlang.io/is/6L6zcH
So that's bad. But it looks like a bug in `-dip1000`, because if
I compile without `-dip1000`, I get:
onlineapp.d(9): Error: cannot take address of local foo in @safe
function main
https://run.dlang.io/is/rHpuf1
Mike