Skip to content

Commit

Permalink
Merge pull request #3627 from 9rnsr/fix12860
Browse files Browse the repository at this point in the history
[REG2.065] Issue 12860 - typeid(_error_) symbols leaked to backend
  • Loading branch information
WalterBright committed Jun 6, 2014
2 parents e051d11 + 47b6059 commit 60d7cb5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/expression.c
Original file line number Diff line number Diff line change
Expand Up @@ -6090,6 +6090,8 @@ Expression *TypeidExp::semantic(Scope *sc)
/* Get the static type
*/
e = ta->getTypeInfo(sc);
if (e->op == TOKerror)
return e;
if (e->loc.linnum == 0)
e->loc = loc; // so there's at least some line number info
if (ea)
Expand Down
1 change: 1 addition & 0 deletions src/tocsym.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ Symbol *toSymbol(Dsymbol *s)
void visit(TypeInfoDeclaration *tid)
{
//printf("TypeInfoDeclaration::toSymbol(%s), linkage = %d\n", tid->toChars(), tid->linkage);
assert(tid->tinfo->ty != Terror);
visit((VarDeclaration *)tid);
}

Expand Down
2 changes: 2 additions & 0 deletions src/typinf.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ void Type::genTypeInfo(Scope *sc)

Expression *Type::getTypeInfo(Scope *sc)
{
if (ty == Terror)
return new ErrorExp();
genTypeInfo(sc);
Expression *e = VarExp::create(Loc(), vtinfo);
e = e->addressOf();
Expand Down

0 comments on commit 60d7cb5

Please sign in to comment.