diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-27 01:13:35 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-27 01:13:35 +0000 |
commit | 9d41e743987553183a6ef1df8913d3fc5423c2e0 (patch) | |
tree | 26e28e95e2cb31ee4adf996aed61902fccb51b2b /signal.c | |
parent | e47a687c83ab7d1084a573e9d12cc82b36f4c63d (diff) |
refactoring (rb_|)threadptr_stack_overflow.
* vm_insnhelper.c (ec_stack_overflow): renamed from threadptr_stack_overflow
and also rb_ec_stack_overflow is from rb_threadptr_stack_overflow
because they accept `ec` instead of `th`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r-- | signal.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -759,7 +759,7 @@ static const char *received_signal; #endif #if defined(USE_SIGALTSTACK) || defined(_WIN32) -NORETURN(void rb_threadptr_stack_overflow(rb_thread_t *th, int crit)); +NORETURN(void rb_ec_stack_overflow(rb_execution_context_t *ec, int crit)); # if defined __HAIKU__ # define USE_UCONTEXT_REG 1 # elif !(defined(HAVE_UCONTEXT_H) && (defined __i386__ || defined __x86_64__ || defined __amd64__)) @@ -838,17 +838,17 @@ check_stack_overflow(int sig, const uintptr_t addr, const ucontext_t *ctx) * the fault page can be the next. */ if (sp_page == fault_page || sp_page == fault_page + 1 || sp_page <= fault_page && fault_page <= bp_page) { - rb_thread_t *th = ruby_current_thread(); + rb_execution_context_t *ec = GET_EC(); int crit = FALSE; - if ((uintptr_t)th->ec->tag->buf / pagesize <= fault_page + 1) { + if ((uintptr_t)ec->tag->buf / pagesize <= fault_page + 1) { /* drop the last tag if it is close to the fault, * otherwise it can cause stack overflow again at the same * place. */ - th->ec->tag = th->ec->tag->prev; + ec->tag = ec->tag->prev; crit = TRUE; } reset_sigmask(sig); - rb_threadptr_stack_overflow(th, crit); + rb_ec_stack_overflow(ec, crit); } } # else @@ -856,10 +856,10 @@ static void check_stack_overflow(int sig, const void *addr) { int ruby_stack_overflowed_p(const rb_thread_t *, const void *); - rb_thread_t *th = GET_THREAD(); - if (ruby_stack_overflowed_p(th, addr)) { + rb_execution_context_t *ec = GET_EC(); + if (ruby_stack_overflowed_p(ec, addr)) { reset_sigmask(sig); - rb_threadptr_stack_overflow(th, FALSE); + rb_ec_stack_overflow(ec, FALSE); } } # endif |