]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Darwin syscalls: correctly set EIP/RIP in ML_(fixup_guest_state_to_restart_syscall)
authorPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 21 Nov 2025 21:02:41 +0000 (22:02 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 21 Nov 2025 21:02:41 +0000 (22:02 +0100)
The code was using arch->vex.guest_IP_AT_SYSCALL but that got cleaned out on amd64
a while ago. Use EIP/RIP - 2 instead, like other x86 and amd64 platforms.

This fixes 5 more memcheck regression tests.

coregrind/m_syswrap/syswrap-main.c

index 02993a58f96bf4a705b48cb2bec313586d4c471d..82f3adc5daaedc1af494382b6a7dd5e0b0610dac 100644 (file)
@@ -2963,7 +2963,7 @@ void ML_(fixup_guest_state_to_restart_syscall) ( ThreadArchState* arch )
    }
 
 #elif defined(VGP_x86_darwin)
-   arch->vex.guest_EIP = arch->vex.guest_IP_AT_SYSCALL; 
+   arch->vex.guest_EIP -= 2;
 
    /* Make sure our caller is actually sane, and we're really backing
       back over a syscall.
@@ -2987,7 +2987,7 @@ void ML_(fixup_guest_state_to_restart_syscall) ( ThreadArchState* arch )
    }
    
 #elif defined(VGP_amd64_darwin)
-   arch->vex.guest_RIP = arch->vex.guest_IP_AT_SYSCALL;
+   arch->vex.guest_RIP -= 2;
     
    /* Make sure our caller is actually sane, and we're really backing
       back over a syscall.