From e45bb6aefba8766cbcd86db40acca10de468149f Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 22 Sep 2010 16:33:13 +0000 Subject: [PATCH] Fix a hard-to-reproduce crash-on-invalid, where we weren't checking for a valid result from ActOnIdExpression git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114548 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaExpr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 79b27273b5..51ef01fce8 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -1401,7 +1401,10 @@ Sema::LookupInObjCMethod(LookupResult &Lookup, Scope *S, SelfName.setIdentifier(&II, SourceLocation()); CXXScopeSpec SelfScopeSpec; ExprResult SelfExpr = ActOnIdExpression(S, SelfScopeSpec, - SelfName, false, false); + SelfName, false, false); + if (SelfExpr.isInvalid()) + return ExprError(); + MarkDeclarationReferenced(Loc, IV); return Owned(new (Context) ObjCIvarRefExpr(IV, IV->getType(), Loc, -- 2.40.0