diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-07 18:50:52 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-07 18:50:52 +0000 |
commit | 0337f21c78bdadff64bc6ae40eb9962d947e5bb0 (patch) | |
tree | bab0e0970ad040f51e5e5e52097007aa8d6a1f0b /lib/Sema | |
parent | 03b986660cc9ae7a08588f99913f2d91e359a65f (diff) |
Diagnose, and not crash, when taking address of property expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74935 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index d6e07bb6b3..97aae8b967 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -4678,6 +4678,11 @@ QualType Sema::CheckAddressOfOperand(Expr *op, SourceLocation OpLoc) { Diag(OpLoc, diag::err_typecheck_address_of) << "vector element" << op->getSourceRange(); return QualType(); + } else if (isa<ObjCPropertyRefExpr>(op)) { + // cannot take address of a property expression. + Diag(OpLoc, diag::err_typecheck_address_of) + << "property expression" << op->getSourceRange(); + return QualType(); } else if (dcl) { // C99 6.5.3.2p1 // We have an lvalue with a decl. Make sure the decl is not declared // with the register storage-class specifier. |