getPrimaryDecl can return null.

llvm-svn: 46638
This commit is contained in:
Anders Carlsson 2008-02-01 16:01:31 +00:00
parent 124c3525d1
commit 59435b2f9a
1 changed files with 1 additions and 1 deletions

View File

@ -1634,7 +1634,7 @@ static ValueDecl *getPrimaryDecl(Expr *e) {
// &X[4] and &4[X] is invalid if X is invalid and X is not a pointer.
ValueDecl *VD = getPrimaryDecl(cast<ArraySubscriptExpr>(e)->getBase());
if (VD->getType()->isPointerType())
if (!VD || VD->getType()->isPointerType())
return 0;
else
return VD;