From 3d307e5610960e358f2d782157c6f5dbd6b5cd10 Mon Sep 17 00:00:00 2001 From: Richard Townsend Date: Wed, 27 Mar 2019 18:30:11 +0000 Subject: [PATCH] fix: correct crash reporter for Windows on Arm (#17533) ARM64 cleans up and moves around RUNTIME_FUNCTION structure fields. With this patch applied, electron should build cleanly for Windows on Arm. --- atom/common/crash_reporter/crash_reporter_win.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/atom/common/crash_reporter/crash_reporter_win.cc b/atom/common/crash_reporter/crash_reporter_win.cc index 318e4ab5968a..02f3cad872c1 100644 --- a/atom/common/crash_reporter/crash_reporter_win.cc +++ b/atom/common/crash_reporter/crash_reporter_win.cc @@ -93,8 +93,13 @@ bool RegisterNonABICompliantCodeRange(void* start, size_t size_in_bytes) { // All addresses are 32bit relative offsets to start. record->runtime_function.BeginAddress = 0; +#if defined(_M_ARM64) + record->runtime_function.FunctionLength = + base::checked_cast(size_in_bytes); +#else record->runtime_function.EndAddress = base::checked_cast(size_in_bytes); +#endif record->runtime_function.UnwindData = offsetof(ExceptionHandlerRecord, unwind_info);