Skip to content

Commit

Permalink
Fix ICE (issue 8262).
Browse files Browse the repository at this point in the history
  • Loading branch information
H. S. Teoh committed Sep 26, 2014
1 parent bc2d215 commit fac98f1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/mtype.c
Expand Up @@ -1246,8 +1246,20 @@ Type *Type::aliasthisOf()
if (s->isAliasDeclaration())
s = s->toAlias();
Declaration *d = s->isDeclaration();
if (d && !d->isTupleDeclaration())
if (d)
{
TupleDeclaration *td = d->isTupleDeclaration();
if (td)
{
assert(td->objects);
if (!td->objects || td->objects->dim != 1)
return Type::terror;
RootObject *o = (*td->objects)[0];
if (o->dyncast() != DYNCAST_EXPRESSION)
return Type::terror;
Expression *e = (Expression *)o;
return e->type;
}
assert(d->type);
Type *t = d->type;
if (d->isVarDeclaration() && d->needThis())
Expand Down Expand Up @@ -1294,6 +1306,7 @@ Type *Type::aliasthisOf()
return Type::terror;
}
//printf("%s\n", s->kind());
return Type::terror;
}
return NULL;
}
Expand Down

0 comments on commit fac98f1

Please sign in to comment.