aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/CGDeclCXX.cpp4
-rw-r--r--test/CodeGenCXX/threadsafe-statics-exceptions.cpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp
index ddb1abc70a..38345e4741 100644
--- a/lib/CodeGen/CGDeclCXX.cpp
+++ b/lib/CodeGen/CGDeclCXX.cpp
@@ -398,6 +398,10 @@ CodeGenFunction::EmitStaticCXXBlockVarDeclInit(const VarDecl &D,
EmitDeclInit(*this, D, GV);
if (ThreadsafeStatics) {
+ // Pop the guard-abort cleanup if we pushed one.
+ if (Exceptions)
+ PopCleanupBlock();
+
// Call __cxa_guard_release. This cannot throw.
Builder.CreateCall(getGuardReleaseFn(*this), GuardVariable);
} else {
diff --git a/test/CodeGenCXX/threadsafe-statics-exceptions.cpp b/test/CodeGenCXX/threadsafe-statics-exceptions.cpp
index 17c10301d4..c91590fd58 100644
--- a/test/CodeGenCXX/threadsafe-statics-exceptions.cpp
+++ b/test/CodeGenCXX/threadsafe-statics-exceptions.cpp
@@ -17,7 +17,7 @@ void f() {
static X x;
// CHECK: call i8* @__cxa_allocate_exception
- // CHECK: invoke void @__cxa_throw
+ // CHECK: call void @__cxa_throw
throw Y();
// Finally, the landing pad.