diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_unwind_win.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_unwind_win.cpp --- a/compiler-rt/lib/sanitizer_common/sanitizer_unwind_win.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_unwind_win.cpp @@ -58,10 +58,17 @@ size = 0; #if defined(_WIN64) +#ifdef __aarch64__ + int machine_type = IMAGE_FILE_MACHINE_ARM64; + stack_frame.AddrPC.Offset = ctx.Pc; + stack_frame.AddrFrame.Offset = ctx.Lr; + stack_frame.AddrStack.Offset = ctx.Sp; +#else int machine_type = IMAGE_FILE_MACHINE_AMD64; stack_frame.AddrPC.Offset = ctx.Rip; stack_frame.AddrFrame.Offset = ctx.Rbp; stack_frame.AddrStack.Offset = ctx.Rsp; +#endif #else int machine_type = IMAGE_FILE_MACHINE_I386; stack_frame.AddrPC.Offset = ctx.Eip; diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp --- a/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp @@ -963,8 +963,13 @@ pc = (uptr)exception_record->ExceptionAddress; #ifdef _WIN64 +#ifdef __aarch64__ + bp = (uptr)context_record->Lr; + sp = (uptr)context_record->Sp; +#else bp = (uptr)context_record->Rbp; sp = (uptr)context_record->Rsp; +#endif #else bp = (uptr)context_record->Ebp; sp = (uptr)context_record->Esp;