diff options
Diffstat (limited to 'reproducers/issue-508.c')
| -rw-r--r-- | reproducers/issue-508.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/reproducers/issue-508.c b/reproducers/issue-508.c index e143183..c8fd251 100644 --- a/reproducers/issue-508.c +++ b/reproducers/issue-508.c @@ -1,13 +1,18 @@ #include <stdio.h> +#include <stdlib.h> +#include <sys/random.h> int main() { int mem = 0x12345678; + int buf = 0; + getrandom(&buf, sizeof(buf), 0); register long rax asm("rax") = 0x1234567812345678; - register int edi asm("edi") = 0x77777777; + register int edi asm("edi") = buf; asm("cmpxchg %[edi],%[mem]" : [ mem ] "+m"(mem), [ rax ] "+r"(rax) : [ edi ] "r"(edi)); long rax2 = rax; printf("rax2 = %lx\n", rax2); + printf("rand= %d\n", buf); } |