[Issue 3042] Segfault on incorrect override

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 20 02:58:09 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3042


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |clugdbug at yahoo.com.au




--- Comment #1 from Don <clugdbug at yahoo.com.au>  2009-07-20 02:58:08 PDT ---

mtype.c, 3699 in DMD2.031. Crashing because t1->next is null.

    Type *t1n = t1->next;
    Type *t2n = t2->next;
+   if (!t1n || !t2n) goto Lnotcovariant;

    if (t1n->equals(t2n))
    goto Lcovariant;

---
It might be appealing to "return 3;" instead of "goto Lnotcovariant; (which
returns 2)", but that's incorrect. The code below should be accepted:

class Base {
    int str();
}
class Derived : Base {
    auto str() {
        return 3;
    }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list