From d900a6d9dd091008b0366fb73a01aac6d910168f Mon Sep 17 00:00:00 2001 From: XMRig Date: Sat, 2 Jun 2018 04:37:12 +0700 Subject: [PATCH] #446 Fixed SIGBUS error on 32 bit ARM CPUs. --- src/crypto/CryptoNight_monero.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/crypto/CryptoNight_monero.h b/src/crypto/CryptoNight_monero.h index ea1622ab..942940a4 100644 --- a/src/crypto/CryptoNight_monero.h +++ b/src/crypto/CryptoNight_monero.h @@ -38,8 +38,9 @@ # define VARIANT1_INIT(part) \ uint64_t tweak1_2_##part = 0; \ if (VARIANT > 0) { \ - volatile const uint64_t a = *reinterpret_cast(input + 35 + part * size); \ - volatile const uint64_t b = *(reinterpret_cast(ctx[part]->state) + 24); \ + uint64_t a, b; \ + memcpy(&a, input + 35 + part * size, sizeof a); \ + memcpy(&b, ctx[part]->state + 192, sizeof b); \ tweak1_2_##part = a ^ b; \ } #endif