]> granicus.if.org Git - clang/commitdiff
When re-raising an exception after a cleanup, we need to call _Unwind_Resume_or_Rethrow
authorJohn McCall <rjmccall@apple.com>
Wed, 11 Aug 2010 20:59:53 +0000 (20:59 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 11 Aug 2010 20:59:53 +0000 (20:59 +0000)
instead of _Unwind_Resume.  With SJLJ exceptions, this is spelled
"_Unwind_SjLj_Resume_or_Rethrow", not "_Unwind_SjLj_Resume", which has
significantly different semantics.

We should actually never be generating a call to _Unwind_SjLj_Resume directly;
even if we were generating true cleanups (which we aren't because of the
horrible hack), we should be calling __cxa_end_cleanup() on ARM.  I
haven't implemented this because there's little point as long as the HH is
present.

I believe this fixes <rdar://problem/8281377>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110851 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGException.cpp
test/CodeGenObjC/unwind-fn.m

index 746f68daee220afcd52aaffa79171245d2e0bac5..dd518cf5efd753c6bd2c545b55231f544827c500 100644 (file)
@@ -270,7 +270,7 @@ llvm::Constant *CodeGenFunction::getUnwindResumeOrRethrowFn() {
                             false);
 
   if (CGM.getLangOptions().SjLjExceptions)
-    return CGM.CreateRuntimeFunction(FTy, "_Unwind_SjLj_Resume");
+    return CGM.CreateRuntimeFunction(FTy, "_Unwind_SjLj_Resume_or_Rethrow");
   return CGM.CreateRuntimeFunction(FTy, "_Unwind_Resume_or_Rethrow");
 }
 
index 48217f07f97469725954df043d147c589c0eec4d..5bfc7dce31a29880f17cc57f454e0272c589e3af 100644 (file)
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -fsjlj-exceptions -fobjc-nonfragile-abi -fexceptions -emit-llvm -o - %s | FileCheck --check-prefix=SJLJ_EH %s
 
 // DEFAULT_EH: declare void @_Unwind_Resume_or_Rethrow(i8*)
-// SJLJ_EH: declare void @_Unwind_SjLj_Resume(i8*)
+// SJLJ_EH: declare void @_Unwind_SjLj_Resume_or_Rethrow(i8*)
 
 void f1(), f2();
 void f0() {