From 223ca5c9abe5a19bd0d8677d732b3ca5d512c4da Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Mon, 18 Feb 2013 17:22:23 +0000 Subject: [PATCH] Prevent crash on multiple user errors (which I cannot reproduce in a small test case). // rdar://13178483. llvm-svn: 175450 --- clang/lib/Sema/SemaExpr.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 933105e..86bd7b8 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 -- 2.7.4