What    |Removed                     |Added
           Keywords|patch                       |
            Summary|Random crashes / heisenbugs |Random crashes / heisenbugs
                   |caused by dmd commit 478    |caused by dmd commit 478:
                   |                            |compiler fucks up vtables

--- Comment #2 from 2010-05-19 19:32:43 PDT ---
The offending commit is 478, not 477.

After some hours of messing around, I've actually managed to create a testcase:

template X(alias fn) {
    alias typeof(fn) X;

void a()(T1 x) {
    alias X!( P; //line 7;

class T1 {
    void foo() {

class T2 : T1 {
    void bla() {
        assert(false); //line 19

void main() {
    a!()(new T2());

The code never calls T2.bla(), only But the assertion on line 19 is
triggered. The problem is that the compiler generates two vtable entries for, and the second entry is "overwritten" by T2.bla. Thus, when it tries to
call by using the second vtable entry, it actually calls T2.bla.

Commenting line 7 makes the problem go away, which hints that the forward
referencing handling is broken. Which doesn't make commit 478 so utterly
unrelated anymore.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to