aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-04-10 16:44:52 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-04-10 16:44:52 +0000
commit5915561b32212af1179a2cabd894f49b4b0dc016 (patch)
tree830f0678704a25b300a825f9e0e2423ca6c49075 /lib/Sema/SemaExpr.cpp
parent2c6dbd7f5586c3acb0024552967268517b753145 (diff)
objective-c: add an assertion for property
expression enterring IsConstProperty function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154406 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 1d8d24882e..bf9b0ae988 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -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();