[runtime] Only do the stack manipulation added by 79e0856ffda4c2566314ba31677fe55f2d7...
authorZoltan Varga <vargaz@gmail.com>
Fri, 8 Nov 2013 01:39:53 +0000 (02:39 +0100)
committerZoltan Varga <vargaz@gmail.com>
Fri, 8 Nov 2013 01:40:06 +0000 (02:40 +0100)
mono/mini/exceptions-amd64.c

index 91c0a8996b706a4c33dec81aab8080e21f0f636d..6f5f16ecef245f42f5c58f18c6360df98d73218f 100644 (file)
@@ -753,6 +753,8 @@ handle_signal_exception (gpointer obj)
        MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
        MonoContext ctx;
 
+       while (TRUE)
+               ;
        memcpy (&ctx, &jit_tls->ex_ctx, sizeof (MonoContext));
 
        if (mono_debugger_handle_exception (&ctx, (MonoObject *)obj))
@@ -775,8 +777,10 @@ mono_arch_setup_async_callback (MonoContext *ctx, void (*async_cb)(void *fun), g
        /* The stack should be unaligned */
        if ((sp % 16) == 0)
                sp -= 8;
+#ifdef __linux__
        /* Preserve the call chain to prevent crashes in the libgcc unwinder (#15969) */
        *(guint64*)sp = ctx->rip;
+#endif
        ctx->rsp = sp;
        ctx->rip = (guint64)async_cb;
 }