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

* reduce UNREACHABLE.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-04-17 04:55:10 +00:00
parent 854a6e47a5
commit 485f88e62e

15
cont.c
View file

@ -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);