Skip to content

Commit

Permalink
Fix exception_ptr check on resume in spawn() implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskohlhoff committed Nov 7, 2023
1 parent 3913eab commit cb9f329
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions asio/include/asio/impl/spawn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ class spawn_handler<Executor, R(exception_ptr)>

static return_type on_resume(result_type& result)
{
if (result)
if (*result)
rethrow_exception(*result);
}

Expand Down Expand Up @@ -628,7 +628,7 @@ class spawn_handler<Executor, R(exception_ptr, T)>

static return_type on_resume(result_type& result)
{
if (result.ex_)
if (*result.ex_)
rethrow_exception(*result.ex_);
return static_cast<return_type&&>(*result.value_);
}
Expand Down Expand Up @@ -745,7 +745,7 @@ class spawn_handler<Executor, R(exception_ptr, Ts...)>

static return_type on_resume(result_type& result)
{
if (result.ex_)
if (*result.ex_)
rethrow_exception(*result.ex_);
return static_cast<return_type&&>(*result.value_);
}
Expand Down

0 comments on commit cb9f329

Please sign in to comment.