Commit 5f14b635 authored by Martin Storsjo's avatar Martin Storsjo Committed by Alexandre Julliard

ntdll: Properly restore x29/x30 for arm64 packed unwind data with local stack.

For the CR == 3 case, x29/x30 should be restored from x29, not from sp, which may have been decremented further for local stack storage. This fixes uwinding the stack for C++ exceptions in code generated by MSVC. Signed-off-by: 's avatarMartin Storsjo <martin@martin.st> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 93ecc54a
......@@ -1558,7 +1558,12 @@ static void *unwind_packed_data( ULONG_PTR base, ULONG_PTR pc, RUNTIME_FUNCTION
if (!skip)
{
if (func->u.s.CR == 3) restore_regs( 29, 2, 0, context, ptrs );
if (func->u.s.CR == 3)
{
DWORD64 *fp = (DWORD64 *) context->u.s.Fp; /* u.X[29] */
context->u.X[29] = fp[0];
context->u.X[30] = fp[1];
}
context->Sp += local_size;
if (fp_size) restore_fpregs( 8, fp_size / 8, int_size, context, ptrs );
if (func->u.s.CR == 1) restore_regs( 30, 1, int_size - 8, context, ptrs );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment