From: Anders Carlsson Date: Fri, 11 Dec 2009 01:00:09 +0000 (+0000) Subject: When extending the lifetime of a temporary, make sure to emit a branch to the cleanup... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6ec687d2ad8b4968675f7baec15ba302b4d7e199;p=clang When extending the lifetime of a temporary, make sure to emit a branch to the cleanup exit block. This fixes a broken module error in LLVMCConfigurationEmitter.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91086 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 873c28cdef..0f351be01c 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -138,9 +138,12 @@ RValue CodeGenFunction::EmitReferenceBindingToExpr(const Expr* E, ClassDecl->getDestructor(getContext()); { - DelayedCleanupBlock scope(*this); + DelayedCleanupBlock Scope(*this); EmitCXXDestructorCall(Dtor, Dtor_Complete, Val.getAggregateAddr()); + + // Make sure to jump to the exit block. + EmitBranch(Scope.getCleanupExitBlock()); } if (Exceptions) { EHCleanupBlock Cleanup(*this);