From ef5090e6a61ef4191b75f0b77cfad3cc24f0d68e Mon Sep 17 00:00:00 2001 From: DimasKovas <34828390+DimasKovas@users.noreply.github.com> Date: Thu, 7 Dec 2023 17:26:43 +0400 Subject: [PATCH] Mark inline asm output as earlyclobber (#4310) --- utils/s2n_random.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/s2n_random.c b/utils/s2n_random.c index 3b0552cde11..78154d85a7e 100644 --- a/utils/s2n_random.c +++ b/utils/s2n_random.c @@ -613,14 +613,14 @@ static int s2n_rand_rdrand_impl(void *data, uint32_t size) __asm__ __volatile__( ".byte 0x0f, 0xc7, 0xf0;\n" "setc %b1;\n" - : "=a"(output.i386_fields.u_low), "=qm"(success_low) + : "=&a"(output.i386_fields.u_low), "=qm"(success_low) : : "cc"); __asm__ __volatile__( ".byte 0x0f, 0xc7, 0xf0;\n" "setc %b1;\n" - : "=a"(output.i386_fields.u_high), "=qm"(success_high) + : "=&a"(output.i386_fields.u_high), "=qm"(success_high) : : "cc"); /* cppcheck-suppress knownConditionTrueFalse */ @@ -644,7 +644,7 @@ static int s2n_rand_rdrand_impl(void *data, uint32_t size) __asm__ __volatile__( ".byte 0x48, 0x0f, 0xc7, 0xf0;\n" "setc %b1;\n" - : "=a"(output.u64), "=qm"(success) + : "=&a"(output.u64), "=qm"(success) : : "cc"); #endif /* defined(__i386__) */