Bug 3042 – Segfault on incorrect override

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-05-31T11:52:00Z
Last change time
2015-06-09T01:27:57Z
Keywords
ice-on-invalid-code, patch
Assigned to
nobody
Creator
ar_other

Comments

Comment #0 by ar_other — 2009-05-31T11:52:40Z
The following segfaults the compiler class Base { abstract int str(); } class Derived : Base { override str() { return "string"; } }
Comment #1 by clugdbug — 2009-07-20T02:58:08Z
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; } }
Comment #2 by clugdbug — 2009-08-12T08:51:45Z
*** Issue 3247 has been marked as a duplicate of this issue. ***
Comment #3 by clugdbug — 2009-09-04T00:26:13Z
*** Issue 3296 has been marked as a duplicate of this issue. ***
Comment #4 by bugzilla — 2009-10-13T13:51:54Z
Fixed dmd 2.034