From ef175baae45add24fc4ab291efb785f93acc7558 Mon Sep 17 00:00:00 2001 From: Nikita Smith Date: Wed, 1 May 2024 15:08:46 -0700 Subject: [PATCH] fix chained unwind info count --- src/unwind/unwind.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/unwind/unwind.c b/src/unwind/unwind.c index 51c65f53..f0d6916e 100644 --- a/src/unwind/unwind.c +++ b/src/unwind/unwind.c @@ -811,8 +811,8 @@ unw_unwind_pe_x64(String8 bindata, PE_BinInfo *bin, U64 base_vaddr, UNW_MemView break; } - U64 code_count_rounded = AlignPow2(unwind_info->codes_num, 2); - U64 code_size = code_count_rounded*sizeof(PE_UnwindOpCode); + U64 code_count_rounded = AlignPow2(unwind_info->codes_num, sizeof(PE_UnwindCode)); + U64 code_size = code_count_rounded*sizeof(PE_UnwindCode); U64 chained_pdata_off = unwind_info_off + sizeof(PE_UnwindInfo) + code_size; last_pdata = pdata;