From ef4f185d9beed6709e6bf843b98f579c5fb38e8c Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 23 Jul 2016 23:49:26 -0400 Subject: [PATCH] Avoid accessing union value through inactive member --- blake2.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blake2.cpp b/blake2.cpp index 2e73bdd1..cb274c99 100644 --- a/blake2.cpp +++ b/blake2.cpp @@ -13,7 +13,8 @@ NAMESPACE_BEGIN(CryptoPP) -// Uncomment for benchmarking C++ against NEON +// Uncomment for benchmarking C++ against SSE2 or NEON +// #undef CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE // #undef CRYPTOPP_BOOL_NEON_INTRINSICS_AVAILABLE // Visual Studio needs both VS2005 (1400) and _M_64 for SSE2 and _mm_set_epi64x() @@ -46,7 +47,7 @@ inline __m128i _mm_set_epi64x(const uint64_t a, const uint64_t b) INT_128_64 v; v.v64[0] = b; v.v64[1] = a; - return v.v128; + return *(reinterpret_cast<__m128i*>(v.v64)); } #endif