mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-14 20:03:14 +01:00
Recent optimization improvements made LLVM realize the store-to-null was unavoidable, so it deleted all of main() and replaced it with 'unreachable'. Because the body of main() no longer even contained a return instruction, calling it caused random code to be ran instead. This happened to be the code that links in the ModuleInfo on my machine, which then returned "successfully".
34 lines
309 B
D
34 lines
309 B
D
module mini.norun_debug11;
|
|
|
|
class C
|
|
{
|
|
}
|
|
|
|
class D : C
|
|
{
|
|
int i = 42;
|
|
}
|
|
|
|
class E : D
|
|
{
|
|
float fp = 3.14f;
|
|
}
|
|
|
|
class F : E
|
|
{
|
|
F f;
|
|
}
|
|
|
|
void main()
|
|
{
|
|
auto c = new C;
|
|
auto d = new D;
|
|
auto e = new E;
|
|
auto f = new F;
|
|
|
|
auto ci = c.classinfo;
|
|
|
|
int* fail = cast(int*) 1;
|
|
*fail = 0;
|
|
}
|