From 62eb9a8e843cd9a1b07b7204a3cb3a35d4662b60 Mon Sep 17 00:00:00 2001 From: John McCall Date: Tue, 10 Aug 2010 18:51:44 +0000 Subject: When initializing a static local, pop the guard-abort EH cleanup after the variable is fully initialized. llvm-svn: 110704 --- clang/lib/CodeGen/CGDeclCXX.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/CodeGen/CGDeclCXX.cpp') diff --git a/clang/lib/CodeGen/CGDeclCXX.cpp b/clang/lib/CodeGen/CGDeclCXX.cpp index ddb1abc70a1..38345e47419 100644 --- a/clang/lib/CodeGen/CGDeclCXX.cpp +++ b/clang/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 { -- cgit v1.2.3