[cfe-commits] r56004 - /cfe/trunk/Driver/RewriteObjC.cpp

Steve Naroff snaroff at apple.com
Tue Sep 9 12:59:12 PDT 2008


Author: snaroff
Date: Tue Sep  9 14:59:12 2008
New Revision: 56004

URL: http://llvm.org/viewvc/llvm-project?rev=56004&view=rev
Log:
Fix <rdar://problem/6197841> try, finally with no catch stops the exception from being propagated

Modified:
    cfe/trunk/Driver/RewriteObjC.cpp

Modified: cfe/trunk/Driver/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteObjC.cpp?rev=56004&r1=56003&r2=56004&view=diff

==============================================================================
--- cfe/trunk/Driver/RewriteObjC.cpp (original)
+++ cfe/trunk/Driver/RewriteObjC.cpp Tue Sep  9 14:59:12 2008
@@ -1380,6 +1380,11 @@
     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;





More information about the cfe-commits mailing list