HomePhabricator

[Coroutine][Sema] Only tighten the suspend call temp lifetime for final awaiter

Authored by lxfind on Oct 12 2020, 12:00 PM.

Description

[Coroutine][Sema] Only tighten the suspend call temp lifetime for final awaiter

In https://reviews.llvm.org/D87470 I added the change to tighten the lifetime of the expression awaiter.await_suspend().address.
Howver it was incorrect. ExprWithCleanups will call the dtor and end the lifetime for all the temps created in the current full expr.
When this is called on a normal await call, we don't want to do that.
We only want to do this for the call on the final_awaiter, to avoid writing into the frame after the frame is destroyed.
This change fixes it, by checking IsImplicit.

Differential Revision: https://reviews.llvm.org/D89066

Details

Committed
lxfindOct 12 2020, 12:00 PM
Differential Revision
D89066: [Coroutine][Sema] Only tighten the suspend call temp lifetime for final awaiter
Parents
rGf09587c64ccb: update .txt --> .md links
Branches
Unknown
Tags
Unknown