From 2d01af8e5667bc1f63b9f08e44d0818a55f2e8ad Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 16 Apr 2024 21:13:53 +0200 Subject: [PATCH] tests: add another explicit barrier Just to be sure compiler cannot optimize this out. --- test/lib/dmsecuretest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/lib/dmsecuretest.c b/test/lib/dmsecuretest.c index 1026e89fd..3c87d6f4a 100644 --- a/test/lib/dmsecuretest.c +++ b/test/lib/dmsecuretest.c @@ -66,6 +66,7 @@ int main (int argc, char *argv[]) rot13(aes); snprintf(table, sizeof(table), "%s %s 0 %s %u", cipher, aes, device, sz); memset(aes, 0, sizeof(aes)); + asm volatile ("" ::: "memory");/* Compiler barrier. */ (void) dm_task_add_target(dmt, 0, sz, "crypt", table); memset(table, 0, sizeof(table)); asm volatile ("" ::: "memory");/* Compiler barrier. */