зеркало из https://github.com/github/ruby.git
* reduce UNREACHABLE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
854a6e47a5
Коммит
485f88e62e
15
cont.c
15
cont.c
|
@ -1093,25 +1093,22 @@ return_fiber(void)
|
|||
{
|
||||
rb_fiber_t *fib;
|
||||
VALUE curr = rb_fiber_current();
|
||||
VALUE prev;
|
||||
GetFiberPtr(curr, fib);
|
||||
|
||||
if (fib->prev == Qnil) {
|
||||
rb_thread_t *th = GET_THREAD();
|
||||
prev = fib->prev;
|
||||
if (NIL_P(prev)) {
|
||||
const VALUE root_fiber = GET_THREAD()->root_fiber;
|
||||
|
||||
if (th->root_fiber != curr) {
|
||||
return th->root_fiber;
|
||||
}
|
||||
else {
|
||||
if (root_fiber == curr) {
|
||||
rb_raise(rb_eFiberError, "can't yield from root fiber");
|
||||
}
|
||||
return root_fiber;
|
||||
}
|
||||
else {
|
||||
VALUE prev = fib->prev;
|
||||
fib->prev = Qnil;
|
||||
return prev;
|
||||
}
|
||||
|
||||
UNREACHABLE;
|
||||
}
|
||||
|
||||
VALUE rb_fiber_transfer(VALUE fib, int argc, VALUE *argv);
|
||||
|
|
Загрузка…
Ссылка в новой задаче