[cfe-commits] r46638 - /cfe/trunk/Sema/SemaExpr.cpp
Anders Carlsson
andersca at mac.com
Fri Feb 1 08:01:32 PST 2008
Author: andersca
Date: Fri Feb 1 10:01:31 2008
New Revision: 46638
URL: http://llvm.org/viewvc/llvm-project?rev=46638&view=rev
Log:
getPrimaryDecl can return null.
Modified:
cfe/trunk/Sema/SemaExpr.cpp
Modified: cfe/trunk/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaExpr.cpp?rev=46638&r1=46637&r2=46638&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/Sema/SemaExpr.cpp Fri Feb 1 10:01:31 2008
@@ -1634,7 +1634,7 @@
// &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;
More information about the cfe-commits
mailing list