From: Fariborz Jahanian Date: Mon, 18 Feb 2013 17:22:23 +0000 (+0000) Subject: Prevent crash on multiple user errors (which I cannot reproduce in X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0dc4ff2209b7b3b5ee479754d12176e43df0cd8e;p=clang 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 --- 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