aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-03 02:28:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-03 02:28:31 +0000
commitaa4e628337a5d08a54620bcfc354b603f3a5d8bf (patch)
treeef50d2413c79536c8b2d0270dba5ebb88567f63d
parent2e85d9c1a5d6ce933cce134545bf11b130f01563 (diff)
downloadruby-aa4e628337a5d08a54620bcfc354b603f3a5d8bf.tar.gz
thread_pthread.c: check stack on co-routine case
* thread_pthread.c (ruby_init_stack): check stack bounds even if get_main_stack succeeded, on the "co-routine" case. https://github.com/ruby/ruby/commit/53953ee#commitcomment-18887413 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--thread_pthread.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6f5590e81d..fe243578ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Sep 3 11:28:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (ruby_init_stack): check stack bounds even if
+ get_main_stack succeeded, on the "co-routine" case.
+ https://github.com/ruby/ruby/commit/53953ee#commitcomment-18887413
+
Fri Sep 2 16:06:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* internal.h (MEMO_V1_SET, MEMO_V2_SET): fix typos. use the macro
diff --git a/thread_pthread.c b/thread_pthread.c
index b8be9bddc5..20e4869a50 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -749,7 +749,7 @@ ruby_init_stack(volatile VALUE *addr
native_main_thread.stack_maxsize = size;
native_main_thread.stack_start = stackaddr;
reserve_stack(stackaddr, size);
- return;
+ goto bound_check;
}
}
#endif
@@ -797,6 +797,9 @@ ruby_init_stack(volatile VALUE *addr
#endif
}
+#if MAINSTACKADDR_AVAILABLE
+ bound_check:
+#endif
/* If addr is out of range of main-thread stack range estimation, */
/* it should be on co-routine (alternative stack). [Feature #2294] */
{