From 8bd3dc64d28bdb3b263838a12aca25587bce661b Mon Sep 17 00:00:00 2001 From: Steve Naroff Date: Tue, 9 Sep 2008 19:59:12 +0000 Subject: [PATCH] Fix try, finally with no catch stops the exception from being propagated git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56004 91177308-0d34-0410-b5e6-96231b3b80d8 --- Driver/RewriteObjC.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Driver/RewriteObjC.cpp b/Driver/RewriteObjC.cpp index 45ce8af6f7..b89e81156d 100644 --- a/Driver/RewriteObjC.cpp +++ b/Driver/RewriteObjC.cpp @@ -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; -- 2.40.0