The call to TRY-EVAL here will invoke set_error() on the receiver if the construction of result_t throws an exception.
As the call to set_error() can potentially end up destroying the operation-state, the subsequent access of state.async-result.valueless_by_exception() is potentially accessing a dangling reference to state.
Instead, we need to have this function return; after set_error() is called. This may mean we need to directly define the expansion of TRY-EVAL instead of using the macro.
The current specification of
schedule_from
algorithm has the following definition forimpls-for<schedule_form_t>::complete
:The call to TRY-EVAL here will invoke
set_error()
on the receiver if the construction ofresult_t
throws an exception. As the call toset_error()
can potentially end up destroying the operation-state, the subsequent access ofstate.async-result.valueless_by_exception()
is potentially accessing a dangling reference tostate
.Instead, we need to have this function
return;
afterset_error()
is called. This may mean we need to directly define the expansion ofTRY-EVAL
instead of using the macro.e.g. something like: