From 4db06151bebcc81ad062d68d361ea03d50f455fb Mon Sep 17 00:00:00 2001 From: lateralusX Date: Tue, 3 Oct 2017 17:01:43 +0200 Subject: [PATCH] Disable none-working stack overflow implementation on Windows x64 full AOT. Temporary disable stack overflow implementation on Windows x64 full AOT until we have a proper fix for: https://bugzilla.xamarin.com/show_bug.cgi?id=59913 --- mono/mini/exceptions-amd64.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/mono/mini/exceptions-amd64.c b/mono/mini/exceptions-amd64.c index cfb3de0d5c0..bf5a35b71dc 100644 --- a/mono/mini/exceptions-amd64.c +++ b/mono/mini/exceptions-amd64.c @@ -139,12 +139,16 @@ static LONG CALLBACK seh_vectored_exception_handler(EXCEPTION_POINTERS* ep) switch (er->ExceptionCode) { case EXCEPTION_STACK_OVERFLOW: - if (mono_arch_handle_exception (ctx, domain->stack_overflow_ex)) { - /* need to restore stack protection once stack is unwound - * restore_stack will restore stack protection and then - * resume control to the saved stack_restore_ctx */ - mono_sigctx_to_monoctx (ctx, &jit_tls->stack_restore_ctx); - ctx->Rip = (guint64)restore_stack; + if (!mono_aot_only) { + if (mono_arch_handle_exception (ctx, domain->stack_overflow_ex)) { + /* need to restore stack protection once stack is unwound + * restore_stack will restore stack protection and then + * resume control to the saved stack_restore_ctx */ + mono_sigctx_to_monoctx (ctx, &jit_tls->stack_restore_ctx); + ctx->Rip = (guint64)restore_stack; + } + } else { + jit_tls->mono_win_chained_exception_needs_run = TRUE; } break; case EXCEPTION_ACCESS_VIOLATION: @@ -181,7 +185,8 @@ static LONG CALLBACK seh_vectored_exception_handler(EXCEPTION_POINTERS* ep) void win32_seh_init() { - restore_stack = get_win32_restore_stack (); + if (!mono_aot_only) + restore_stack = get_win32_restore_stack (); mono_old_win_toplevel_exception_filter = SetUnhandledExceptionFilter(seh_unhandled_exception_filter); mono_win_vectored_exception_handle = AddVectoredExceptionHandler (1, seh_vectored_exception_handler); -- 2.25.1