Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 8bd3dc6

Browse files
author
Steve Naroff
committed
Fix <rdar://problem/6197841> 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
1 parent 81bebb1 commit 8bd3dc6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: Driver/RewriteObjC.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1380,6 +1380,11 @@ Stmt *RewriteObjC::RewriteObjCTryStmt(ObjCAtTryStmt *S) {
13801380
buf += " else { /* @catch continue */";
13811381

13821382
InsertText(startLoc, buf.c_str(), buf.size());
1383+
} else { /* no catch list */
1384+
buf = "}\nelse {\n";
1385+
buf += " _rethrow = objc_exception_extract(&_stack);\n";
1386+
buf += "}";
1387+
ReplaceText(lastCurlyLoc, 1, buf.c_str(), buf.size());
13831388
}
13841389
bool sawIdTypedCatch = false;
13851390
Stmt *lastCatchBody = 0;

0 commit comments

Comments
 (0)