From cab244d4684af55158b8ae29b7aa3b67842f9806 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Mon, 17 Jan 2022 19:59:21 +0100 Subject: [PATCH] Fixed GhostRider benchmark on single-core systems Fixes #2871 --- src/crypto/ghostrider/ghostrider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto/ghostrider/ghostrider.cpp b/src/crypto/ghostrider/ghostrider.cpp index 43a721097..505378c02 100644 --- a/src/crypto/ghostrider/ghostrider.cpp +++ b/src/crypto/ghostrider/ghostrider.cpp @@ -293,7 +293,7 @@ void benchmark() hwloc_obj_t pu = hwloc_get_pu_obj_by_os_index(topology, thread_index1); hwloc_obj_t pu2; hwloc_get_closest_objs(topology, pu, &pu2, 1); - uint32_t thread_index2 = pu2->os_index; + uint32_t thread_index2 = pu2 ? pu2->os_index : thread_index1; if (thread_index2 < thread_index1) { std::swap(thread_index1, thread_index2);