SEG-V at expression.c:6255, know issue?

BCS none at anon.com
Thu Jan 21 18:12:23 PST 2010


Hello BCS,

> I'm getting a seg-v (not an assert) at expression.c:6255 from some
> template code. Is this a know issue or sould I put some work into
> cutting it down?
> 

FWIW this "fixes" the problem into an assert

 Expression *DotTemplateInstanceExp::semantic(Scope *sc)
 {
 #if LOGSEMANTIC
     printf("DotTemplateInstanceExp::semantic('%s')\n", toChars());
 #endif
     Expression *eleft;
     Expression *e = new DotIdExp(loc, e1, ti->name);
 L1:
     e = e->semantic(sc);
     if (e->op == TOKdottd)
     {
 	DotTemplateExp *dte = (DotTemplateExp *)e;
 	TemplateDeclaration *td = dte->td;
 	eleft = dte->e1;
 	ti->tempdecl = td;
 	ti->semantic(sc);
+	assert(ti->inst != NULL);
 	Dsymbol *s = ti->inst->toAlias();
 	Declaration *v = s->isDeclaration();
 	if (v)
 	{   e = new DotVarExp(loc, eleft, v);
 	    e = e->semantic(sc);
 	    return e;
 	}
 	e = new ScopeExp(loc, ti);
 	e = new DotExp(loc, eleft, e);
 	e = e->semantic(sc);
 	return e;
     }
     else if (e->op == TOKimport)
     {   ScopeExp *se = (ScopeExp *)e;
 	TemplateDeclaration *td = se->sds->isTemplateDeclaration();




More information about the Digitalmars-d-bugs mailing list