about summary refs log tree commit diff stats
path: root/reproducers/issue-508.c
diff options
context:
space:
mode:
authorTheofilos Augoustis <37243696+taugoust@users.noreply.github.com>2025-11-19 10:10:21 +0100
committerGitHub <noreply@github.com>2025-11-19 10:10:21 +0100
commitdae5b391c2042ca70359cf9c93e62b1d4c903e71 (patch)
treec2f56e740ffd13200af31530f6693593bd500ac0 /reproducers/issue-508.c
parentba5864bd653a995bc72405f0a5e7c389e4052e44 (diff)
parent97d9a0330c3c09023a82d39b10100ff816b0d846 (diff)
downloadfocaccia-dae5b391c2042ca70359cf9c93e62b1d4c903e71.tar.gz
focaccia-dae5b391c2042ca70359cf9c93e62b1d4c903e71.zip
Merge pull request #27 from TUM-DSE/ta/emu-replay
Implement basic replaying for QEMU
Diffstat (limited to 'reproducers/issue-508.c')
-rw-r--r--reproducers/issue-508.c7
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);
 }