aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-02-18 17:22:23 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-02-18 17:22:23 +0000
commit0dc4ff2209b7b3b5ee479754d12176e43df0cd8e (patch)
treed08eab73298882bd80dfba457a17fffbcf7ca066 /lib/Sema/SemaExpr.cpp
parent3b1a40fedc489e8ad90476d9966ce39e93b86b44 (diff)
Prevent crash on multiple user errors (which I cannot reproduce in
a small test case). // rdar://13178483. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 933105e628..86bd7b85cc 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -1976,6 +1976,10 @@ Sema::LookupInObjCMethod(LookupResult &Lookup, Scope *S,
IdentifierInfo *II, bool AllowBuiltinCreation) {
SourceLocation Loc = Lookup.getNameLoc();
ObjCMethodDecl *CurMethod = getCurMethodDecl();
+
+ // Check for error condition which is already reported.
+ if (!CurMethod)
+ return ExprError();
// There are two cases to handle here. 1) scoped lookup could have failed,
// in which case we should look for an ivar. 2) scoped lookup could have