]> granicus.if.org Git - clang/commitdiff
fixes an objc crash involving objc bool literal on
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 16 Oct 2012 16:21:20 +0000 (16:21 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 16 Oct 2012 16:21:20 +0000 (16:21 +0000)
hopelessly poorly written code after spewing several
errors. // rdar://12491143

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166025 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index 3d66baa925907d02f6fe95d374bafcd977309483..02eac1190ba84debc5d03196b203aa1e7543fd25 100644 (file)
@@ -11917,7 +11917,7 @@ Sema::ActOnObjCBoolLiteral(SourceLocation OpLoc, tok::TokenKind Kind) {
   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);