forked from OSchip/llvm-project
parent
124c3525d1
commit
59435b2f9a
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue