From 901a68866e08a9efebfb0af8e572a18bcf8b7925 Mon Sep 17 00:00:00 2001 From: Cra3z <3324654761@qq.com> Date: Sat, 13 Jun 2026 19:28:34 +0800 Subject: [PATCH 1/5] Unnecessary `set_error(exception_ptr)` for the receiver of the `continues_on` sender --- include/beman/execution/detail/continues_on.hpp | 8 ++++++-- .../beman/execution/detail/unstoppable_scheduler.hpp | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/beman/execution/detail/continues_on.hpp b/include/beman/execution/detail/continues_on.hpp index f626a50f..f9a461f6 100644 --- a/include/beman/execution/detail/continues_on.hpp +++ b/include/beman/execution/detail/continues_on.hpp @@ -182,6 +182,7 @@ struct continues_on_t { State* state; auto set_value() && noexcept -> void { + constexpr bool nothrow = std::is_nothrow_move_constructible_vasync_result)>; try { ::std::visit( [this](Tuple& result) noexcept -> void { @@ -195,7 +196,9 @@ struct continues_on_t { }, state->async_result); } catch (...) { - ::beman::execution::set_error(::std::move(state->receiver), ::std::current_exception()); + if constexpr (!nothrow) { + ::beman::execution::set_error(::std::move(state->receiver), ::std::current_exception()); + } } } @@ -266,8 +269,9 @@ struct continues_on_t { state.async_result.template emplace(Tag(), std::forward(args)...); }(); } catch (...) { - if constexpr (not nothrow) + if constexpr (!nothrow) { ::beman::execution::set_error(::std::move(receiver), ::std::current_exception()); + } } if (state.async_result.index() == 0) diff --git a/include/beman/execution/detail/unstoppable_scheduler.hpp b/include/beman/execution/detail/unstoppable_scheduler.hpp index 5f8a8b70..9d4a3e37 100644 --- a/include/beman/execution/detail/unstoppable_scheduler.hpp +++ b/include/beman/execution/detail/unstoppable_scheduler.hpp @@ -23,7 +23,7 @@ import beman.execution.detail.unstoppable; // ---------------------------------------------------------------------------- namespace beman::execution::detail { -template +template <::beman::execution::scheduler Sched> struct unstoppable_scheduler { using scheduler_concept = typename Sched::scheduler_concept; @@ -33,8 +33,10 @@ struct unstoppable_scheduler { return sched.query(q, ::std::forward(args)...); } - auto schedule() const noexcept(std::is_nothrow_invocable_v<::beman::execution::schedule_t, Sched>) { - return ::beman::execution::unstoppable(::beman::execution::schedule(sched)); + template + requires requires { ::beman::execution::schedule(::std::declval().sched); } + auto schedule(this Self&& self) noexcept(noexcept(::beman::execution::schedule(::std::declval().sched))) { + return ::beman::execution::unstoppable(::beman::execution::schedule(::std::forward(self).sched)); } friend auto operator==(const unstoppable_scheduler& lhs, const unstoppable_scheduler& rhs) -> bool = default; @@ -43,4 +45,6 @@ struct unstoppable_scheduler { }; } // namespace beman::execution::detail +// ---------------------------------------------------------------------------- + #endif // INCLUDED_INCLUDE_BEMAN_EXECUTION_DETAIL_UNSTOPPABLE_SCHEDULER From 14f0f37a44f9d8d0a1293c2b80141467e143c9fb Mon Sep 17 00:00:00 2001 From: Cra3z <3324654761@qq.com> Date: Sat, 13 Jun 2026 20:03:45 +0800 Subject: [PATCH 2/5] Remove unnecessary std::tuple_size/std::tuple_element workaround for MSVC 19.51 --- src/beman/execution/basic_sender.cppm | 2 +- src/beman/execution/product_type.cppm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/beman/execution/basic_sender.cppm b/src/beman/execution/basic_sender.cppm index eeaf4a7e..b6342d11 100644 --- a/src/beman/execution/basic_sender.cppm +++ b/src/beman/execution/basic_sender.cppm @@ -12,7 +12,7 @@ namespace beman::execution::detail { export using beman::execution::detail::basic_sender; } // namespace beman::execution::detail -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSVC_VER <= 1944L namespace std { export template struct tuple_size<::beman::execution::detail::basic_sender> diff --git a/src/beman/execution/product_type.cppm b/src/beman/execution/product_type.cppm index 0c64ad22..e2cfc502 100644 --- a/src/beman/execution/product_type.cppm +++ b/src/beman/execution/product_type.cppm @@ -14,7 +14,7 @@ export using beman::execution::detail::product_type; } // namespace beman::execution::detail -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSVC_VER <= 1944L namespace std { export template struct tuple_size<::beman::execution::detail::product_type>; From bb173c963ca0a41d046bd10b0337b167fcecaaec Mon Sep 17 00:00:00 2001 From: Cra3z <3324654761@qq.com> Date: Mon, 15 Jun 2026 21:40:27 +0800 Subject: [PATCH 3/5] Fix typo --- src/beman/execution/basic_sender.cppm | 2 +- src/beman/execution/product_type.cppm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/beman/execution/basic_sender.cppm b/src/beman/execution/basic_sender.cppm index b6342d11..97b4ed85 100644 --- a/src/beman/execution/basic_sender.cppm +++ b/src/beman/execution/basic_sender.cppm @@ -12,7 +12,7 @@ namespace beman::execution::detail { export using beman::execution::detail::basic_sender; } // namespace beman::execution::detail -#if defined(_MSC_VER) && _MSVC_VER <= 1944L +#if defined(_MSC_VER) && _MSC_VER <= 1944L namespace std { export template struct tuple_size<::beman::execution::detail::basic_sender> diff --git a/src/beman/execution/product_type.cppm b/src/beman/execution/product_type.cppm index e2cfc502..c5b9614c 100644 --- a/src/beman/execution/product_type.cppm +++ b/src/beman/execution/product_type.cppm @@ -14,7 +14,7 @@ export using beman::execution::detail::product_type; } // namespace beman::execution::detail -#if defined(_MSC_VER) && _MSVC_VER <= 1944L +#if defined(_MSC_VER) && _MSC_VER <= 1944L namespace std { export template struct tuple_size<::beman::execution::detail::product_type>; From 1f390695bcea92d7d0e5c0b62d11e41b9b6e09d8 Mon Sep 17 00:00:00 2001 From: Cra3z <3324654761@qq.com> Date: Mon, 15 Jun 2026 21:40:27 +0800 Subject: [PATCH 4/5] Fix use-after-free in when_all-cancel.cpp --- examples/when_all-cancel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/when_all-cancel.cpp b/examples/when_all-cancel.cpp index b80483ef..17d51f06 100644 --- a/examples/when_all-cancel.cpp +++ b/examples/when_all-cancel.cpp @@ -105,8 +105,9 @@ struct eager { ex::set_error(std::move(st->outer_receiver), std::forward(e)); } auto set_stopped() && noexcept -> void { + auto st_ = st; st->inner_state.reset(); - ex::set_stopped(std::move(st->outer_receiver)); + ex::set_stopped(std::move(st_->outer_receiver)); } auto get_env() const noexcept -> env { return ex::get_env(st->outer_receiver); } From ff9dfd74cfdd4eed7385e5dc92f882477f0d7fbb Mon Sep 17 00:00:00 2001 From: Cra3z Date: Tue, 16 Jun 2026 10:04:32 +0800 Subject: [PATCH 5/5] Fix CI error --- tests/beman/execution/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/beman/execution/CMakeLists.txt b/tests/beman/execution/CMakeLists.txt index 3dbfbc33..59e58f6a 100644 --- a/tests/beman/execution/CMakeLists.txt +++ b/tests/beman/execution/CMakeLists.txt @@ -155,6 +155,7 @@ if(BEMAN_EXECUTION_INSTALL_CONFIG_FILE_PACKAGE AND NOT CMAKE_SKIP_INSTALL_RULES) --build-generator ${CMAKE_GENERATOR} # --build-makeprogram ${CMAKE_MAKE_PROGRAM} # --build-options # + "-D BEMAN_BUILDSYS_SANITIZER=${BEMAN_BUILDSYS_SANITIZER}" "-D BEMAN_USE_MODULES=${BEMAN_USE_MODULES}" "-D BEMAN_USE_STD_MODULE=${BEMAN_USE_STD_MODULE}" "-D CMAKE_BUILD_TYPE=$"