-
- Downloads
c++, coroutines: Make the resume index consistent for debug.
At present, we only update the resume index when we actually are
at the stage that the coroutine is considered suspended. This is
on the basis that it is UB to resume or destroy a coroutines that
is not suspended (and therefore we never need to access this value
otherwise). However, it is possible that someone could set a debug
breakpoint on the resume which can be reached without suspending
if await_ready() returns true. In that case, the debugger would
read an incorrect resume index. Fixed by moving the update to
just before the test for ready.
gcc/cp/ChangeLog:
* coroutines.cc (expand_one_await_expression): Update the
resume index before checking if the coroutine is ready.
Signed-off-by:
Iain Sandoe <iain@sandoe.co.uk>
Loading
Please register or sign in to comment