diff options
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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); |