summaryrefslogtreecommitdiff
path: root/cont.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-07 03:48:13 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-07 03:48:13 +0000
commit8620de6b042f2c069a25d7fdbf5b1d5a3ffd87a9 (patch)
tree3d81704bfc7da4924e439606c392d64180fb74a5 /cont.c
parentb60d64b001c8819e6626b00efbeae96560368a08 (diff)
* cont.c (cont_restore_1): fix to check root fiber [ruby-dev:30911].
* test/ruby/test_fiber.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cont.c b/cont.c
index 4210ab97d5..97a805d0ab 100644
--- a/cont.c
+++ b/cont.c
@@ -173,11 +173,14 @@ cont_restore_1(rb_context_t *cont)
}
else {
/* continuation */
+ VALUE fval;
+
th->fiber = sth->fiber;
+ fval = th->fiber ? th->fiber : th->root_fiber;
- if (th->fiber) {
+ if (fval) {
rb_context_t *fcont;
- GetContPtr(th->fiber, fcont);
+ GetContPtr(fval, fcont);
th->stack_size = fcont->saved_thread.stack_size;
th->stack = fcont->saved_thread.stack;
}