[cfe-commits] r166025 - /cfe/trunk/lib/Sema/SemaExpr.cpp

Fariborz Jahanian fjahanian at apple.com
Tue Oct 16 09:21:20 PDT 2012


Author: fjahanian
Date: Tue Oct 16 11:21:20 2012
New Revision: 166025

URL: http://llvm.org/viewvc/llvm-project?rev=166025&view=rev
Log:
fixes an objc crash involving objc bool literal on
hopelessly poorly written code after spewing several
errors. // rdar://12491143

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=166025&r1=166024&r2=166025&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Oct 16 11:21:20 2012
@@ -11917,7 +11917,7 @@
   if (!Context.getBOOLDecl()) {
     LookupResult Result(*this, &Context.Idents.get("BOOL"), SourceLocation(),
                         Sema::LookupOrdinaryName);
-    if (LookupName(Result, getCurScope())) {
+    if (LookupName(Result, getCurScope()) && Result.isSingleResult()) {
       NamedDecl *ND = Result.getFoundDecl();
       if (TypedefDecl *TD = dyn_cast<TypedefDecl>(ND)) 
         Context.setBOOLDecl(TD);





More information about the cfe-commits mailing list