summaryrefslogtreecommitdiffstats
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
commit223ca5c9abe5a19bd0d8677d732b3ca5d512c4da (patch)
tree0e72887ea8e2bb92b7d6fe26fd7476fcb1f057fb
parent879c90807d44c20bf75d1858f6b7a3f1e1f2926f (diff)
downloadbcm5719-llvm-223ca5c9abe5a19bd0d8677d732b3ca5d512c4da.tar.gz
bcm5719-llvm-223ca5c9abe5a19bd0d8677d732b3ca5d512c4da.zip
Prevent crash on multiple user errors (which I cannot reproduce in
a small test case). // rdar://13178483. llvm-svn: 175450
-rw-r--r--clang/lib/Sema/SemaExpr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 933105e6281..86bd7b85cc1 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud