[PATCH 2/3] ntdll: Pass a nonnull handler_data when continuing after a collided unwind on arm64

Martin Storsjo martin at martin.st
Mon May 18 07:16:28 CDT 2020


This fixes crashes when handling GNU/mingw style SEH based C++
exceptions on arm64; in these cases unwind_full_data ended up
where it tries to write handler_rva + 1 to *handler_data.

Signed-off-by: Martin Storsjo <martin at martin.st>
---
 dlls/ntdll/signal_arm64.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c
index 390315bf93..8227d10fbb 100644
--- a/dlls/ntdll/signal_arm64.c
+++ b/dlls/ntdll/signal_arm64.c
@@ -1870,7 +1870,8 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec
                 dispatch.ContextRecord = context;
                 RtlVirtualUnwind( UNW_FLAG_NHANDLER, dispatch.ImageBase,
                                   dispatch.ControlPc, dispatch.FunctionEntry,
-                                  &new_context, NULL, &frame, NULL );
+                                  &new_context, &dispatch.HandlerData, &frame,
+                                  NULL );
                 rec->ExceptionFlags |= EH_COLLIDED_UNWIND;
                 goto unwind_done;
             }
@@ -1893,7 +1894,8 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec
                     dispatch.ContextRecord = context;
                     RtlVirtualUnwind( UNW_FLAG_NHANDLER, dispatch.ImageBase,
                                       dispatch.ControlPc, dispatch.FunctionEntry,
-                                      &new_context, NULL, &frame, NULL );
+                                      &new_context, &dispatch.HandlerData,
+                                      &frame, NULL );
                     rec->ExceptionFlags |= EH_COLLIDED_UNWIND;
                     goto unwind_done;
                 }
-- 
2.17.1




More information about the wine-devel mailing list