mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* thread_pthread.c (ruby_init_stack): ignore `STACK_END_ADDRESS'
if Ruby interpreter is running on co-routine. [Feature #2294] https://bugs.ruby-lang.org/issues/2294#note-18 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fa30ebc3c7
commit
e5481ccd8e
2 changed files with 28 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
Wed Jan 23 13:35:37 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* thread_pthread.c (ruby_init_stack): ignore `STACK_END_ADDRESS'
|
||||
if Ruby interpreter is running on co-routine.
|
||||
[Feature #2294]
|
||||
https://bugs.ruby-lang.org/issues/2294#note-18
|
||||
|
||||
Wed Jan 23 12:28:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* win32/win32.c (rb_w32_spawn, rb_w32_aspawn_flags): check the results
|
||||
|
|
|
@ -643,6 +643,27 @@ ruby_init_stack(volatile VALUE *addr
|
|||
native_main_thread.stack_maxsize = space;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* If addr is out of range of main-thread stack range estimation, */
|
||||
/* it should be on co-routine (alternative stack). [Feature #2294] */
|
||||
{
|
||||
void *start, *end;
|
||||
|
||||
if (IS_STACK_DIR_UPPER()) {
|
||||
start = native_main_thread.stack_start;
|
||||
end = (char *)native_main_thread.stack_start + native_main_thread.stack_maxsize;
|
||||
}
|
||||
else {
|
||||
start = (char *)native_main_thread.stack_start - native_main_thread.stack_maxsize;
|
||||
end = native_main_thread.stack_start;
|
||||
}
|
||||
|
||||
if ((void *)addr < start || (void *)addr > end) {
|
||||
/* out of range */
|
||||
native_main_thread.stack_start = (VALUE *)addr;
|
||||
native_main_thread.stack_maxsize = 0; /* unknown */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define CHECK_ERR(expr) \
|
||||
|
|
Loading…
Reference in a new issue