Skip to content

Commit

Permalink
Mark inline asm output as earlyclobber (#4310)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimasKovas authored Dec 7, 2023
1 parent b5d8560 commit ef5090e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/s2n_random.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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__) */
Expand Down

0 comments on commit ef5090e

Please sign in to comment.