From 604d993f2869e46302d06fefae1535bac9c1fb80 Mon Sep 17 00:00:00 2001 From: Antoniu Pop Date: Thu, 9 Mar 2023 11:41:02 +0000 Subject: [PATCH] fix(DFRuntime): fix make_ready_future compilation with GCC 12+ (wrt. -Werror=use-after-free). --- compilers/concrete-compiler/compiler/Makefile | 3 ++- .../concrete-compiler/compiler/lib/Runtime/DFRuntime.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/compilers/concrete-compiler/compiler/Makefile b/compilers/concrete-compiler/compiler/Makefile index 7b465bba5..da9c64a60 100644 --- a/compilers/concrete-compiler/compiler/Makefile +++ b/compilers/concrete-compiler/compiler/Makefile @@ -91,7 +91,8 @@ install-hpx-from-source: $(HPX_LOCAL_DIR) -DHPX_WITH_MAX_CPU_COUNT="" \ -DHPX_WITH_FETCH_ASIO=on \ -DHPX_FILESYSTEM_WITH_BOOST_FILESYSTEM_COMPATIBILITY=ON \ - -DHPX_WITH_MALLOC=system .. + -DHPX_WITH_MALLOC=system \ + $(CXX_COMPILER_OPTION) $(CC_COMPILER_OPTION) .. cd $(HPX_LOCAL_DIR)/build && make -j2 $(HPX_TARBALL): diff --git a/compilers/concrete-compiler/compiler/lib/Runtime/DFRuntime.cpp b/compilers/concrete-compiler/compiler/lib/Runtime/DFRuntime.cpp index cf002c4f7..fefb7e075 100644 --- a/compilers/concrete-compiler/compiler/lib/Runtime/DFRuntime.cpp +++ b/compilers/concrete-compiler/compiler/lib/Runtime/DFRuntime.cpp @@ -54,9 +54,9 @@ typedef struct dfr_refcounted_future { // await_future), so we only need to track the references in task // creation. void *_dfr_make_ready_future(void *in, size_t memref_clone_p) { + hpx::future future = hpx::make_ready_future(in); return (void *)new dfr_refcounted_future_t( - new hpx::shared_future(hpx::make_ready_future(in)), 1, - memref_clone_p); + new hpx::shared_future(std::move(future)), 1, memref_clone_p); } void *_dfr_await_future(void *in) {