From 3c139ca3336ed3ff5fc343fa3d96716513263901 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 1 Jul 2023 13:37:50 +0800 Subject: [PATCH] Fix potential use-after-move The evaluation order for function parameters is unspecified in C++. https://stackoverflow.com/questions/2934904/order-of-evaluation-in-c-function-parameters Fix up 1b2ff0f6f8f93c4e3d3aff38359b1b2037a13378. --- src/base/bittorrent/sessionimpl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/base/bittorrent/sessionimpl.cpp b/src/base/bittorrent/sessionimpl.cpp index 043ae3c4a..33c8624ad 100644 --- a/src/base/bittorrent/sessionimpl.cpp +++ b/src/base/bittorrent/sessionimpl.cpp @@ -6091,7 +6091,8 @@ void SessionImpl::processTrackerStatuses() #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) updatedTrackerEntries[trackerEntry.url] = std::move(trackerEntry); #else - updatedTrackerEntries.emplace(trackerEntry.url, std::move(trackerEntry)); + const QString url = trackerEntry.url; + updatedTrackerEntries.emplace(url, std::move(trackerEntry)); #endif }