llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[Coroutines] Incorrect behavior if symmetric transferred coroutine throws exceptions

Open ChuanqiXu9 opened this issue 1 year ago • 2 comments

The symmetric transfer would enforce the resuming call to be an musttail call. However, it is problematic if there is an exception throw from the resuming call. In this case, we can't catch the exception in the parent function's unhandled_exception(). Also the parent coroutine couldn't be marked as done, which violates the spec too.

This is showed in: https://godbolt.org/z/eTGd3M37f

ChuanqiXu9 avatar Aug 16 '22 07:08 ChuanqiXu9

@llvm/issue-subscribers-coroutines

llvmbot avatar Aug 16 '22 07:08 llvmbot

It is fine if we don't use symmetric transfer: https://godbolt.org/z/YP3vYsfEE

ChuanqiXu9 avatar Aug 16 '22 07:08 ChuanqiXu9

According to the discussion in WG21, this is consistency with the design intention.

ChuanqiXu9 avatar Aug 10 '23 08:08 ChuanqiXu9