diff options
author | Steve Naroff <snaroff@apple.com> | 2008-09-09 19:59:12 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-09-09 19:59:12 +0000 |
commit | fac18fe2ee18df098626007137350dfa00c16bab (patch) | |
tree | 98e495e92d8842dec88f73a1338ee87e15acc3ed /clang | |
parent | e5579930dbf61d59611b877df01587f6a4700e4c (diff) | |
download | bcm5719-llvm-fac18fe2ee18df098626007137350dfa00c16bab.tar.gz bcm5719-llvm-fac18fe2ee18df098626007137350dfa00c16bab.zip |
Fix <rdar://problem/6197841> try, finally with no catch stops the exception from being propagated
llvm-svn: 56004
Diffstat (limited to 'clang')
-rw-r--r-- | clang/Driver/RewriteObjC.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/Driver/RewriteObjC.cpp b/clang/Driver/RewriteObjC.cpp index 45ce8af6f7f..b89e81156d2 100644 --- a/clang/Driver/RewriteObjC.cpp +++ b/clang/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; |