diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index 4c634efb1064..17b6fa4b48da 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -134,6 +134,8 @@ RValue CodeGenFunction::EmitCompoundStmt(const CompoundStmt &S, bool GetLast, // Keep track of the current cleanup stack depth. size_t CleanupStackDepth = CleanupEntries.size(); + bool OldDidCallStackSave = DidCallStackSave; + // Push a null stack save value. StackSaveValues.push_back(0); @@ -174,6 +176,8 @@ RValue CodeGenFunction::EmitCompoundStmt(const CompoundStmt &S, bool GetLast, Builder.CreateCall(F, V); } + DidCallStackSave = OldDidCallStackSave; + EmitCleanupBlocks(CleanupStackDepth); return RV;