[PATCH] D75664: [Coroutines] Also check lifetime intrinsic for local variable when build coroutine frame
JunMa via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 9 03:44:01 PDT 2020
junparser added a comment.
In D75664#1912080 <https://reviews.llvm.org/D75664#1912080>, @junparser wrote:
> It seems that this patch also fix some workaround in folly, https://github.com/facebook/folly/blob/master/folly/Portability.h#L501, This is the same behavior as well as our coroutine library
@wenlei, according to lewissbaker's comment on await object:
So within the await_suspend() method, once it’s possible for the coroutine to be resumed concurrently on another thread, you need to make sure that you avoid accessing this or the coroutine’s .promise() object because both could already be destroyed. In general, the only things that are safe to access after the operation is started and the coroutine is scheduled for resumption are local variables within await_suspend().
when local variable becomes frame variable, data race may happens.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75664/new/
https://reviews.llvm.org/D75664
More information about the llvm-commits
mailing list