[Issue 1787] Compiler segfaults on circular references.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Aug 13 00:22:16 PDT 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1787
Don <clugdbug at yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
--- Comment #4 from Don <clugdbug at yahoo.com.au> 2009-08-13 00:22:15 PDT ---
This patch isn't great, but since it's already got a proper fix in D2, it might
be OK.
Index: mtype.c
===================================================================
--- mtype.c (revision 192)
+++ mtype.c (working copy)
@@ -4313,6 +4313,11 @@
s = s->toAlias();
v = s->isVarDeclaration();
+ if (v && v->isConst() && !v->type) {
+ // BUG 1787. TODO: This isn't the best place for this error message,
but it prevents a segfault
+ error(e->loc, "Cannot infer type of %s", v->toChars());
+ return e;
+ }
if (v && v->isConst() && v->type->toBasetype()->ty != Tsarray)
{ ExpInitializer *ei = v->getExpInitializer();
--
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