Module: wine Branch: master Commit: 41d7baa0139252f66042313f366b199e710f7b7b URL: https://gitlab.winehq.org/wine/wine/-/commit/41d7baa0139252f66042313f366b199...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Feb 16 12:41:03 2024 +0100
ntdll: Ignore home parameters saving when unwinding epilog on ARM64.
---
dlls/ntdll/tests/exception.c | 8 ++++---- dlls/ntdll/unwind.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 6fb02a62bc8..a4f1a706c3f 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -8724,10 +8724,10 @@ static void test_virtual_unwind(void) { 0x14, 0x00, 0, ORIG_LR, 0x050, TRUE, { {x19, 0x00}, {-1,-1} }}, { 0x18, 0x00, 0, ORIG_LR, 0x070, TRUE, { {x19, 0x20}, {-1,-1} }}, { 0x1c, 0x00, 0, ORIG_LR, 0x070, TRUE, { {x19, 0x20}, {-1,-1} }}, - { 0x20, 0x00, 0, ORIG_LR, 0x050, TRUE, { {x19, 0x00}, {-1,-1} }}, - { 0x24, 0x00, 0, ORIG_LR, 0x050, TRUE, { {x19, 0x00}, {-1,-1} }}, - { 0x28, 0x00, 0, ORIG_LR, 0x050, TRUE, { {x19, 0x00}, {-1,-1} }}, - { 0x2c, 0x00, 0, ORIG_LR, 0x050, TRUE, { {x19, 0x00}, {-1,-1} }}, + { 0x20, 0x00, 0, ORIG_LR, 0x070, TRUE, { {x19, 0x20}, {-1,-1} }}, + { 0x24, 0x00, 0, ORIG_LR, 0x070, TRUE, { {x19, 0x20}, {-1,-1} }}, + { 0x28, 0x00, 0, ORIG_LR, 0x070, TRUE, { {x19, 0x20}, {-1,-1} }}, + { 0x2c, 0x00, 0, ORIG_LR, 0x070, TRUE, { {x19, 0x20}, {-1,-1} }}, { 0x30, 0x00, 0, ORIG_LR, 0x050, TRUE, { {x19, 0x00}, {-1,-1} }}, { 0x34, 0x00, 0, ORIG_LR, 0x000, TRUE, { {-1,-1} }}, }; diff --git a/dlls/ntdll/unwind.c b/dlls/ntdll/unwind.c index 7ca744bc4f8..f13d3ba09ae 100644 --- a/dlls/ntdll/unwind.c +++ b/dlls/ntdll/unwind.c @@ -489,7 +489,7 @@ static void *unwind_packed_data( ULONG_PTR base, ULONG_PTR pc, ARM64_RUNTIME_FUN { int i; unsigned int len, offset, skip = 0; - unsigned int int_size = func->RegI * 8, fp_size = func->RegF * 8, regsave, local_size; + unsigned int int_size = func->RegI * 8, fp_size = func->RegF * 8, h_size = func->H * 4, regsave, local_size; unsigned int int_regs, fp_regs, saved_regs, local_size_regs;
TRACE( "function %I64x-%I64x: len=%#x flag=%x regF=%u regI=%u H=%u CR=%u frame=%x\n", @@ -530,14 +530,14 @@ static void *unwind_packed_data( ULONG_PTR base, ULONG_PTR pc, ARM64_RUNTIME_FUN if (local_size > 4088) len++; /* sub sp,sp,#4088 */ break; } - len += 4 * func->H; - if (offset < len) /* prolog */ + if (offset < len + h_size) /* prolog */ { - skip = len - offset; + skip = len + h_size - offset; } else if (offset >= func->FunctionLength - (len + 1)) /* epilog */ { skip = offset - (func->FunctionLength - (len + 1)); + h_size = 0; } } } @@ -584,7 +584,7 @@ static void *unwind_packed_data( ULONG_PTR base, ULONG_PTR pc, ARM64_RUNTIME_FUN break; }
- if (func->H) pos += 4; + pos += h_size;
if (fp_size) {