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.
This commit is contained in:
iphydf 2018-08-11 12:56:39 +00:00
parent 2730c95699
commit ff342a5ba6
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9

View File

@ -29,7 +29,8 @@ enum {
clock_t memcmp_time(void *a, void *b, size_t len) { clock_t memcmp_time(void *a, void *b, size_t len) {
clock_t start = clock(); clock_t start = clock();
crypto_memcmp(a, b, len); volatile int result = crypto_memcmp(a, b, len);
(void)result;
return clock() - start; return clock() - start;
} }