summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-22 05:08:34 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-22 05:08:34 (GMT)
commit1634ac4d641fa81bbb6a2af8f8fd93be3baca820 (patch)
tree0c9d09a6ffa520326f1868bb74eaa18944f7330a /signal.c
parent458cffce1a42a0dda7832f69f386e7abac8b621f (diff)
signal.c: fix received_signal
* signal.c (received_signal): fix condition to define. [ruby-core:67032] [Bug #10629] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/signal.c b/signal.c
index 90683d9..30769c1 100644
--- a/signal.c
+++ b/signal.c
@@ -743,10 +743,15 @@ rb_get_next_signal(void)
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 addr, const ucontext_t *ctx)
* 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)
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);
}
}