Skip to content

Commit

Permalink
Force storing the result of crypto_memcmp in the test.
Browse files Browse the repository at this point in the history
So we don't accidentally elide the call given that it's a pure function
and its result isn't used.
  • Loading branch information
iphydf committed Aug 23, 2018
1 parent 2730c95 commit ff342a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion toxcore/crypto_core_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ enum {

clock_t memcmp_time(void *a, void *b, size_t len) {
clock_t start = clock();
crypto_memcmp(a, b, len);
volatile int result = crypto_memcmp(a, b, len);
(void)result;
return clock() - start;
}

Expand Down

0 comments on commit ff342a5

Please sign in to comment.