Skip to content

Commit ddbcd9f

Browse files
committed
Fix assembly to only test the valid 8 bits of register EAX
Currently we test all 32 bits, but the upper 24 bits could be garbage depending on what the compiler does. If any of those bits are set we'll think we're in replay when we're really recording.
1 parent c772ea6 commit ddbcd9f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/preload/syscallbuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,7 @@ static void memcpy_input_parameter(void* buf, void* src, int size) {
15981598
*/
15991599
static void rdtsc_recording_only(uint32_t buf[2]) {
16001600
unsigned char tmp_in_replay = *rr_page_replay_flag_addr();
1601-
__asm__ __volatile__("test %%eax,%%eax\n\t"
1601+
__asm__ __volatile__("test %%al,%%al\n\t"
16021602
"jne 1f\n\t"
16031603
"rdtsc\n\t"
16041604
"mov %%eax,(%1)\n\t"

0 commit comments

Comments
 (0)