You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module thisbuginc;
//import std.algorithm;
class Foo
{
struct Bar
{
int opCmp(ref const Bar rhs) const
{ return sortOrder(this, rhs); }
private final static int sortOrder(ref const Bar a, ref const Bar b) {
return 0;
}
}
auto sortedBars(Bar[] bars) {
return sort(bars);
}
}
the command ldc2 -c thisbug.d prints an error message and crashes with release 0.12.0 (bad). If the merge-2.064 branch is used then ldc crashes with no error message printed (worse).
DMD compiles the module without problems.
A deeper analysis shows that the buggy types are referenced during vtable construction in the codegen phase. Because of the error, semantic3() has not been run. Then missing information leads to the crash.
DMD does not need the type information for the vtable construction and therefore compiles fine.
If you fix the bug (remove the comment) then ldc compiles the module, too.
The text was updated successfully, but these errors were encountered:
With the files
thisbug.d
and
thisbuginc.d
the command
ldc2 -c thisbug.d
prints an error message and crashes with release 0.12.0 (bad). If the merge-2.064 branch is used then ldc crashes with no error message printed (worse).DMD compiles the module without problems.
A deeper analysis shows that the buggy types are referenced during vtable construction in the codegen phase. Because of the error,
semantic3()
has not been run. Then missing information leads to the crash.DMD does not need the type information for the vtable construction and therefore compiles fine.
If you fix the bug (remove the comment) then ldc compiles the module, too.
The text was updated successfully, but these errors were encountered: