[Issue 3493] Segfault(cast.c) Forward reference with type inference, D1 only.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Nov 17 23:55:06 PST 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3493
Don <clugdbug at yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
--- Comment #1 from Don <clugdbug at yahoo.com.au> 2009-11-17 23:55:05 PST ---
This doesn't segfault in D2 because in expression.c, VarExp::semantic(),
line 4152, the initializer part is commented out.
VarDeclaration *v = var->isVarDeclaration();
if (v)
{
+#if 0
if ((v->isConst() || v->isInvariant()) &&
type->toBasetype()->ty != Tsarray && v->init)
{
ExpInitializer *ei = v->init->isExpInitializer();
if (ei)
{
//ei->exp->implicitCastTo(sc, type)->print();
return ei->exp->implicitCastTo(sc, type);
}
}
+#endif
v->checkNestedReference(sc, loc);
#if DMDV2
Doing the same thing in D1 fixes this bug, and the DMD test suite still passes.
However I'm not sure why the code above is unnecessary.
--
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