From f5f4d2fd2e47463276a310dc5164dfbcdb582f1c Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 13 Dec 2012 23:37:17 +0000 Subject: Make sure the __invoke function for lambdas returns properly. Per bug report on IRC> llvm-svn: 170160 --- clang/lib/CodeGen/CGClass.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/CodeGen/CGClass.cpp') diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index b2225e4..9df8905b 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/lib/CodeGen/CGClass.cpp @@ -1787,6 +1787,8 @@ void CodeGenFunction::EmitForwardingCallToLambda(const CXXRecordDecl *lambda, // If necessary, copy the returned value into the slot. if (!resultType->isVoidType() && returnSlot.isNull()) EmitReturnOfRValue(RV, resultType); + else + EmitBranchThroughCleanup(ReturnBlock); } void CodeGenFunction::EmitLambdaBlockInvokeBody() { -- cgit v1.1