diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-08-11 12:56:39 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-08-23 22:26:46 +0000 |
commit | ff342a5ba68f4f0e16d876af2020a88da916b377 (patch) | |
tree | 7eea1d01062b78f58c82338a726465d5b7c53f63 /toxcore/crypto_core_test.cc | |
parent | 2730c95699a0968b6deee2533cc806b24803a0ea (diff) |
Force storing the result of crypto_memcmp in the test.
So we don't accidentally elide the call given that it's a pure function
and its result isn't used.
Diffstat (limited to 'toxcore/crypto_core_test.cc')
-rw-r--r-- | toxcore/crypto_core_test.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/toxcore/crypto_core_test.cc b/toxcore/crypto_core_test.cc index 1fbdd296..cdc315b2 100644 --- a/toxcore/crypto_core_test.cc +++ b/toxcore/crypto_core_test.cc | |||
@@ -29,7 +29,8 @@ enum { | |||
29 | 29 | ||
30 | clock_t memcmp_time(void *a, void *b, size_t len) { | 30 | clock_t memcmp_time(void *a, void *b, size_t len) { |
31 | clock_t start = clock(); | 31 | clock_t start = clock(); |
32 | crypto_memcmp(a, b, len); | 32 | volatile int result = crypto_memcmp(a, b, len); |
33 | (void)result; | ||
33 | return clock() - start; | 34 | return clock() - start; |
34 | } | 35 | } |
35 | 36 | ||