]> granicus.if.org Git - clang/commitdiff
Patch for objc's zero-const exception to not assume
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 27 Jul 2009 23:12:41 +0000 (23:12 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 27 Jul 2009 23:12:41 +0000 (23:12 +0000)
that @catch(...) cathces all exceptions (c++ objects
are not cought by that).

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

lib/CodeGen/CGObjCMac.cpp

index 080f979ce977a78a64800cec040d744cdabf6d50..f02e513bdf0a1547ab786b0e87ad61ad5bedf3c1 100644 (file)
@@ -5464,18 +5464,17 @@ CGObjCNonFragileABIMac::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF,
                                        llvm::GlobalValue::ExternalLinkage,
                                        0, "OBJC_EHTYPE_id");
           SelectorArgs.push_back(IDEHType);
-          HasCatchAll = true;
-          break;
         } 
-
-        // All other types should be Objective-C interface pointer types.
-        const ObjCObjectPointerType *PT = 
-          CatchDecl->getType()->getAsObjCObjectPointerType();
-        assert(PT && "Invalid @catch type.");
-        const ObjCInterfaceType *IT = PT->getInterfaceType();
-        assert(IT && "Invalid @catch type.");
-        llvm::Value *EHType = GetInterfaceEHType(IT->getDecl(), false);
-        SelectorArgs.push_back(EHType);
+        else {
+          // All other types should be Objective-C interface pointer types.
+          const ObjCObjectPointerType *PT = 
+            CatchDecl->getType()->getAsObjCObjectPointerType();
+          assert(PT && "Invalid @catch type.");
+          const ObjCInterfaceType *IT = PT->getInterfaceType();
+          assert(IT && "Invalid @catch type.");
+          llvm::Value *EHType = GetInterfaceEHType(IT->getDecl(), false);
+          SelectorArgs.push_back(EHType);
+        }
       }
     }
   }