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

Wenlei He via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 12 11:28:53 PDT 2020


wenlei accepted this revision.
wenlei added a comment.
This revision is now accepted and ready to land.

LGTM. I think we can get this in first to address the fall out from https://reviews.llvm.org/D87470, while investigating ASAN failure.



================
Comment at: clang/lib/Sema/SemaCoroutine.cpp:401
 
-  // The coroutine handle used to obtain the address is no longer needed
-  // at this point, clean it up to avoid unnecessarily long lifetime which
-  // could lead to unnecessary spilling.
-  JustAddress = S.MaybeCreateExprWithCleanups(JustAddress);
+  // After the suspend call on the final awaiter, the coroutine may have
+  // been destroyed. In that case, we can not store anything to the frame
----------------
Can you add comment explaining why we don't cleanup for all await, probably a TODO? 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89066/new/

https://reviews.llvm.org/D89066



More information about the cfe-commits mailing list