File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -857,7 +857,11 @@ void CodeGenFunction::EmitCoroutineBody(const CoroutineBodyStmt &S) {
857857 // parameter copies.
858858 for (const ParmVarDecl *Parm : FnArgs) {
859859 // If the original param is in an alloca, exclude it from the coroutine
860- // frame. The parameter copy will be part of the frame.
860+ // frame. The parameter copy will be part of the frame, but the original
861+ // parameter memory should remain on the stack. This is necessary to
862+ // ensure that parameters destroyed in callees, as with `trivial_abi` or
863+ // in the MSVC C++ ABI, are appropriately destroyed after setting up the
864+ // coroutine.
861865 Address ParmAddr = GetAddrOfLocalVar (Parm);
862866 if (auto *ParmAlloca =
863867 dyn_cast<llvm::AllocaInst>(ParmAddr.getBasePointer ())) {
You can’t perform that action at this time.
0 commit comments