From db1dd21762974c2a1cab00c411dcab61e1759998 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 21 Apr 2017 01:02:40 +0200 Subject: [PATCH] Prevent possible compiler optimizations --- src/libsodium/sodium/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsodium/sodium/utils.c b/src/libsodium/sodium/utils.c index 56bb777d..0ab8c044 100644 --- a/src/libsodium/sodium/utils.c +++ b/src/libsodium/sodium/utils.c @@ -124,8 +124,8 @@ sodium_memcmp(const void *const b1_, const void *const b2_, size_t len) const volatile unsigned char *volatile b2 = (const volatile unsigned char *volatile) b2_; #endif - size_t i; - unsigned char d = (unsigned char) 0U; + size_t i; + volatile unsigned char d = (unsigned char) 0U; #if HAVE_WEAK_SYMBOLS _sodium_dummy_symbol_to_prevent_memcmp_lto(b1, b2, len);