]> granicus.if.org Git - clang/commitdiff
Fix <rdar://problem/6197841> try, finally with no catch stops the exception from...
authorSteve Naroff <snaroff@apple.com>
Tue, 9 Sep 2008 19:59:12 +0000 (19:59 +0000)
committerSteve Naroff <snaroff@apple.com>
Tue, 9 Sep 2008 19:59:12 +0000 (19:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56004 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteObjC.cpp

index 45ce8af6f7f60c2969d1fa74cc2b1c77d33408da..b89e81156d2a4c7a5bc4a70940f91c0d7c1139a7 100644 (file)
@@ -1380,6 +1380,11 @@ Stmt *RewriteObjC::RewriteObjCTryStmt(ObjCAtTryStmt *S) {
     buf += " else { /* @catch continue */";
     
     InsertText(startLoc, buf.c_str(), buf.size());
+  } else { /* no catch list */
+    buf = "}\nelse {\n";
+    buf += "  _rethrow = objc_exception_extract(&_stack);\n";
+    buf += "}";
+    ReplaceText(lastCurlyLoc, 1, buf.c_str(), buf.size());
   }
   bool sawIdTypedCatch = false;
   Stmt *lastCatchBody = 0;