diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-09-23 23:11:38 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-09-23 23:11:38 +0000 |
commit | bc2b91a8f682023acb6543257f7c08f68ea964ae (patch) | |
tree | 27a58510f0918d90f710417bf411f4e841703925 /lib/Sema/SemaExpr.cpp | |
parent | 10904527359605a76561a49769a2199351a072d8 (diff) |
objc - fixes a crash when undefined typed property
followed by it implementation crashes when attempt
is made to access the synthesized ivar.
// rdar://10177744
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140432 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 4dd43c8857..31eb19e174 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -1702,7 +1702,10 @@ ExprResult Sema::ActOnIdExpression(Scope *S, if (ObjCIvarDecl *Ivar = R.getAsSingle<ObjCIvarDecl>()) { R.clear(); ExprResult E(LookupInObjCMethod(R, S, Ivar->getIdentifier())); - assert(E.isInvalid() || E.get()); + // In a hopelessly buggy code, Objective-C instance variable + // lookup fails and no expression will be built to reference it. + if (!E.isInvalid() && !E.get()) + return ExprError(); return move(E); } } |