]> granicus.if.org Git - clang/commitdiff
Fix a hard-to-reproduce crash-on-invalid, where we weren't checking for a valid resul...
authorDouglas Gregor <dgregor@apple.com>
Wed, 22 Sep 2010 16:33:13 +0000 (16:33 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 22 Sep 2010 16:33:13 +0000 (16:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114548 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index 79b27273b5da0d87c3ae1eca7e62ed0e5e2a4513..51ef01fce864d853c6b090fbbaf34a9f79bd9268 100644 (file)
@@ -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,