From d0be5f7739ec0edd918cd9beb0f69a6865ee13db Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Thu, 10 Jul 2025 02:16:29 +0200 Subject: [PATCH] Fixed use-after-move in TaskLoop::addTaskImpl() and some minor compilation problems. --- source/mijin/async/coroutine.hpp | 4 ++-- source/mijin/util/string.hpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/mijin/async/coroutine.hpp b/source/mijin/async/coroutine.hpp index b81136b..f9d2eee 100644 --- a/source/mijin/async/coroutine.hpp +++ b/source/mijin/async/coroutine.hpp @@ -779,7 +779,7 @@ void TaskHandle::cancel() const MIJIN_NOEXCEPT } } -Optional TaskHandle::getLocation() const noexcept +Optional TaskHandle::getLocation() const MIJIN_NOEXCEPT { if (std::shared_ptr state = state_.lock()) { @@ -825,7 +825,7 @@ FuturePtr TaskLoop::addTaskImpl(TaskBase>> allocator(allocator_); - addStoredTask(StoredTask(wrapTask(std::move(allocator), std::move(task)), std::move(setFuture), std::move(future))); + addStoredTask(StoredTask(wrapTask(std::move(allocator), std::move(task)), std::move(setFuture), future)); return future; } diff --git a/source/mijin/util/string.hpp b/source/mijin/util/string.hpp index 8ba7e40..33cacad 100644 --- a/source/mijin/util/string.hpp +++ b/source/mijin/util/string.hpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include