Skip to content

Commit

Permalink
6870 additional - Fix null dereference problem
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Nov 14, 2011
1 parent 4af3787 commit 541330a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mtype.c
Expand Up @@ -6352,7 +6352,6 @@ Type *TypeTypeof::semantic(Loc loc, Scope *sc)
goto Lerr;
}
t = exp->type;
t = t->addMod(mod);
if (!t)
{
error(loc, "expression (%s) has no type", exp->toChars());
Expand All @@ -6363,6 +6362,8 @@ Type *TypeTypeof::semantic(Loc loc, Scope *sc)
goto Lerr;
}

t = t->addMod(mod);

/* typeof should reflect the true type,
* not what 'auto' would have gotten us.
*/
Expand Down

0 comments on commit 541330a

Please sign in to comment.