r175450 - Prevent crash on multiple user errors (which I cannot reproduce in

Fariborz Jahanian fjahanian at apple.com
Mon Feb 18 09:22:23 PST 2013


Author: fjahanian
Date: Mon Feb 18 11:22:23 2013
New Revision: 175450

URL: http://llvm.org/viewvc/llvm-project?rev=175450&view=rev
Log:
Prevent crash on multiple user errors (which I cannot reproduce in
a small test case). // rdar://13178483.

Modified:
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=175450&r1=175449&r2=175450&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Feb 18 11:22:23 2013
@@ -1976,6 +1976,10 @@ Sema::LookupInObjCMethod(LookupResult &L
                          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





More information about the cfe-commits mailing list