objective-c: add an assertion for property

expression enterring IsConstProperty function.

llvm-svn: 154406
This commit is contained in:
Fariborz Jahanian 2012-04-10 16:44:52 +00:00
parent 96f7aeeb67
commit e84595d618
1 changed files with 5 additions and 0 deletions

View File

@ -7146,6 +7146,11 @@ static bool IsReadonlyProperty(Expr *E, Sema &S) {
static bool IsConstProperty(Expr *E, Sema &S) {
const ObjCPropertyRefExpr *PropExpr = dyn_cast<ObjCPropertyRefExpr>(E);
if (!PropExpr) return false;
assert(!S.Context.hasSameType(PropExpr->getType(),
S.Context.PseudoObjectTy)
&& "property expression cannot be a pseudo object");
if (PropExpr->isImplicitProperty()) return false;
ObjCPropertyDecl *PDecl = PropExpr->getExplicitProperty();