]> granicus.if.org Git - clang/commitdiff
When initializing a static local, pop the guard-abort EH cleanup after
authorJohn McCall <rjmccall@apple.com>
Tue, 10 Aug 2010 18:51:44 +0000 (18:51 +0000)
committerJohn McCall <rjmccall@apple.com>
Tue, 10 Aug 2010 18:51:44 +0000 (18:51 +0000)
the variable is fully initialized.

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

lib/CodeGen/CGDeclCXX.cpp
test/CodeGenCXX/threadsafe-statics-exceptions.cpp

index ddb1abc70a164b847413939d834eae9e52be7210..38345e474190304809e727eb77205c9c9dcec970 100644 (file)
@@ -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 {
index 17c10301d4fa9c1dc083e43bad1af0976b34434d..c91590fd58b87e44dc8c28eb6cc5b497785589f4 100644 (file)
@@ -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.