ruby-changes:36839
From: nobu <ko1@a...>
Date: Mon, 22 Dec 2014 14:08:48 +0900 (JST)
Subject: [ruby-changes:36839] nobu:r48920 (trunk): signal.c: fix received_signal
nobu 2014-12-22 14:08:34 +0900 (Mon, 22 Dec 2014) New Revision: 48920 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48920 Log: signal.c: fix received_signal * signal.c (received_signal): fix condition to define. [ruby-core:67032] [Bug #10629] Modified files: trunk/ChangeLog trunk/signal.c Index: ChangeLog =================================================================== --- ChangeLog (revision 48919) +++ ChangeLog (revision 48920) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Dec 22 14:08:31 2014 Nobuyoshi Nakada <nobu@r...> + + * signal.c (received_signal): fix condition to define. + [ruby-core:67032] [Bug #10629] + Sun Dec 21 10:51:51 2014 Masaki Suketa <masaki.suketa@n...> * test/win32ole/test_win32ole_event.rb: test_s_new_exception is Index: signal.c =================================================================== --- signal.c (revision 48919) +++ signal.c (revision 48920) @@ -743,10 +743,15 @@ rb_get_next_signal(void) https://github.com/ruby/ruby/blob/trunk/signal.c#L743 return sig; } +#if defined SIGSEGV || defined SIGBUS || defined SIGILL || defined SIGFPE +static const char *received_signal; +# define clear_received_signal() (void)(received_signal = 0) +#else +# define clear_received_signal() ((void)0) +#endif #if defined(USE_SIGALTSTACK) || defined(_WIN32) NORETURN(void ruby_thread_stack_overflow(rb_thread_t *th)); -static const char *received_signal; # if !(defined(HAVE_UCONTEXT_H) && (defined __i386__ || defined __x86_64__ || defined __amd64__)) # elif defined __linux__ # define USE_UCONTEXT_REG 1 @@ -793,7 +798,7 @@ check_stack_overflow(const uintptr_t add https://github.com/ruby/ruby/blob/trunk/signal.c#L798 * place. */ th->tag = th->tag->prev; } - received_signal = 0; + clear_received_signal(); ruby_thread_stack_overflow(th); } } @@ -804,7 +809,7 @@ check_stack_overflow(const void *addr) https://github.com/ruby/ruby/blob/trunk/signal.c#L809 int ruby_stack_overflowed_p(const rb_thread_t *, const void *); rb_thread_t *th = ruby_current_thread; if (ruby_stack_overflowed_p(th, addr)) { - received_signal = 0; + clear_received_signal(); ruby_thread_stack_overflow(th); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/