Remove #ifdefs so ss_flags is always set to zero.
authorJack Pappas <jack.pappas@gmail.com>
Sat, 23 Feb 2013 02:06:25 +0000 (21:06 -0500)
committerJack Pappas <jack.pappas@gmail.com>
Sat, 23 Feb 2013 02:06:25 +0000 (21:06 -0500)
Removed the #ifdefs which used a different value for 'ss_flags' on Linux.
According to the POSIX standard, the SS_ONSTACK flag can never be used as input to the 'sigaltstack' function -- it can only be set by the 'sigaltstack' function itself, and tested after the function returns.

mono/mini/mini-exceptions.c

index d25c43286313cd626fb2e80b090dec06964f712c..ece328263f554386e5ab305795a783559a05139c 100644 (file)
@@ -2002,12 +2002,7 @@ mono_setup_altstack (MonoJitTlsData *tls)
 
        sa.ss_sp = tls->signal_stack;
        sa.ss_size = MONO_ARCH_SIGNAL_STACK_SIZE;
-#if __linux__
-  sa.ss_flags = SS_ONSTACK;
-#else
-       /* Mac OS X, BSD */
        sa.ss_flags = 0;
-#endif
        g_assert (sigaltstack (&sa, NULL) == 0);
 
        mono_gc_register_altstack ((char*)tls->stack_ovf_guard_base + tls->stack_ovf_guard_size, (char*)staddr + stsize - ((char*)tls->stack_ovf_guard_base + tls->stack_ovf_guard_size), tls->signal_stack, tls->signal_stack_size);