aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-09-22 16:33:13 +0000
committerDouglas Gregor <dgregor@apple.com>2010-09-22 16:33:13 +0000
commite45bb6aefba8766cbcd86db40acca10de468149f (patch)
tree72b886198d0387d6c43272c1fdbf943138a2e060 /lib/Sema/SemaExpr.cpp
parent78a916ec5ff5b66adec3c499e1b9af7b87668309 (diff)
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
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp5
1 files changed, 4 insertions, 1 deletions
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,