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

* signal.c (check_stack_overflow): Don't use ucontext_t if ucontext.h

is not available.
  Fixes build on Android (x86).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2014-04-09 23:16:10 +00:00
parent 3f05ee0f42
commit f0cbb868e7
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,9 @@
Thu Apr 10 08:13:47 2014 Tanaka Akira <akr@fsij.org>
* signal.c (check_stack_overflow): Don't use ucontext_t if ucontext.h
is not available.
Fixes build on Android (x86).
Wed Apr 9 23:22:44 2014 Tanaka Akira <akr@fsij.org>
* gc.c (mark_current_machine_context): Call SET_STACK_END.

View file

@ -636,7 +636,7 @@ rb_get_next_signal(void)
#if defined(USE_SIGALTSTACK) || defined(_WIN32)
NORETURN(void ruby_thread_stack_overflow(rb_thread_t *th));
#if defined __linux__ && (defined __i386__ || defined __x86_64__)
#if defined(HAVE_UCONTEXT_H) && defined __linux__ && (defined __i386__ || defined __x86_64__)
static void
check_stack_overflow(const uintptr_t addr, const ucontext_t *ctx)
{
@ -665,7 +665,7 @@ check_stack_overflow(const void *addr)
#define CHECK_STACK_OVERFLOW() check_stack_overflow(0)
#else
#define FAULT_ADDRESS info->si_addr
#if defined __linux__ && (defined __i386__ || defined __x86_64__)
#if defined(HAVE_UCONTEXT_H) && defined __linux__ && (defined __i386__ || defined __x86_64__)
# define CHECK_STACK_OVERFLOW() check_stack_overflow((uintptr_t)FAULT_ADDRESS, ctx)
#else
# define CHECK_STACK_OVERFLOW() check_stack_overflow(FAULT_ADDRESS)