aboutsummaryrefslogtreecommitdiffstats
path: root/cont.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-15 23:40:33 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-15 23:40:33 +0000
commitd910af94d51727e94e547ad4588876f9a741cf6b (patch)
tree339c3f246212f32f73f1258c6b4a3432058dc1bd /cont.c
parent397271caa378d3d682a0b55fbc089b891567bde4 (diff)
downloadruby-d910af94d51727e94e547ad4588876f9a741cf6b.tar.gz
cont.c: fix when FIBER_USE_NATIVE is 0
* cont.c (fiber_store): restore references to next_fib (fix typo) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cont.c b/cont.c
index f5835ebab0..3c069e4945 100644
--- a/cont.c
+++ b/cont.c
@@ -1377,11 +1377,15 @@ fiber_store(rb_fiber_t *next_fib, rb_thread_t *th)
/* restored */
fib = th->fiber;
if (fib->cont.argc == -1) rb_exc_raise(fib->cont.value);
+ if (next_fib->cont.value == Qundef) {
+ cont_restore_0(&next_fib->cont, &next_fib->cont.value);
+ rb_bug("rb_fiber_resume: unreachable");
+ }
return fib->cont.value;
}
else {
VALUE undef = Qundef;
- cont_restore_0(&fib->cont, &undef);
+ cont_restore_0(&next_fib->cont, &undef);
rb_bug("rb_fiber_resume: unreachable");
}
#endif /* FIBER_USE_NATIVE */