1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

signal.c: removed raise_stack_overflow:

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-08-22 02:42:23 +00:00
parent 59d8fefab7
commit 2f3eef8ee0

View file

@ -774,14 +774,13 @@ NORETURN(void rb_threadptr_stack_overflow(rb_thread_t *th));
# elif defined __FreeBSD__ # elif defined __FreeBSD__
# define USE_UCONTEXT_REG 1 # define USE_UCONTEXT_REG 1
# endif # endif
NORETURN(static void raise_stack_overflow(int sig, rb_thread_t *th));
#if defined(HAVE_PTHREAD_SIGMASK) #if defined(HAVE_PTHREAD_SIGMASK)
# define ruby_sigunmask pthread_sigmask # define ruby_sigunmask pthread_sigmask
#elif defined(HAVE_SIGPROCMASK) #elif defined(HAVE_SIGPROCMASK)
# define ruby_sigunmask sigprocmask # define ruby_sigunmask sigprocmask
#endif #endif
static void static void
raise_stack_overflow(int sig, rb_thread_t *th) reset_sigmask(int sig)
{ {
#if defined(ruby_sigunmask) #if defined(ruby_sigunmask)
sigset_t mask; sigset_t mask;
@ -794,7 +793,6 @@ raise_stack_overflow(int sig, rb_thread_t *th)
rb_bug_errno(STRINGIZE(ruby_sigunmask)":unblock", errno); rb_bug_errno(STRINGIZE(ruby_sigunmask)":unblock", errno);
} }
#endif #endif
rb_threadptr_stack_overflow(th);
} }
# ifdef USE_UCONTEXT_REG # ifdef USE_UCONTEXT_REG
@ -851,7 +849,8 @@ check_stack_overflow(int sig, const uintptr_t addr, const ucontext_t *ctx)
* place. */ * place. */
th->ec.tag = th->ec.tag->prev; th->ec.tag = th->ec.tag->prev;
} }
raise_stack_overflow(sig, th); reset_sigmask(sig);
rb_threadptr_stack_overflow(th);
} }
} }
# else # else
@ -861,7 +860,8 @@ check_stack_overflow(int sig, const void *addr)
int ruby_stack_overflowed_p(const rb_thread_t *, const void *); int ruby_stack_overflowed_p(const rb_thread_t *, const void *);
rb_thread_t *th = ruby_current_thread; rb_thread_t *th = ruby_current_thread;
if (ruby_stack_overflowed_p(th, addr)) { if (ruby_stack_overflowed_p(th, addr)) {
raise_stack_overflow(sig, th); reset_sigmask(sig);
rb_threadptr_stack_overflow(th);
} }
} }
# endif # endif