]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
FreeBSD vgdb: ensure stack is 16byte aligned for invoker
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 28 Sep 2025 02:11:58 +0000 (02:11 +0000)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 28 Sep 2025 02:11:58 +0000 (02:11 +0000)
I haven't seen any issues but there's no harm in being certain.

coregrind/vgdb-invoker-freebsd.c

index 607e059919c178e6482559dac3d62430b6cea9ea..4a89fb37dd083d9de3662ee372ce31129df8938a 100644 (file)
@@ -561,6 +561,7 @@ Bool invoker_invoke_gdbserver (pid_t pid)
       reg_mod.r_rip = shared64->invoke_gdbserver;
 #elif defined(VGA_arm64)
       reg_mod.x[0] = check;
+      sp &= ~0xf; // keep the stack aligned on 16 bytes ...
       reg_mod.sp = sp;
       reg_mod.elr = shared64->invoke_gdbserver;
       /* put NULL return address in Link Register */