mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* cont.c (rb_cont_call): forbid calling dead fiber with
Cotinuation#call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a96aacb08c
commit
15b31b0d80
2 changed files with 13 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed Jun 6 10:55:42 2007 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* cont.c (rb_cont_call): forbid calling dead fiber with
|
||||
Cotinuation#call.
|
||||
|
||||
Wed Jun 6 10:50:01 2007 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* compile.c (iseq_compile_each): fix around yield arguments
|
||||
|
|
8
cont.c
8
cont.c
|
@ -344,6 +344,14 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval)
|
|||
if (cont->saved_thread.trap_tag != th->trap_tag) {
|
||||
rb_raise(rb_eRuntimeError, "continuation called across trap");
|
||||
}
|
||||
if (cont->saved_thread.fiber) {
|
||||
rb_context_t *fcont;
|
||||
GetContPtr(cont->saved_thread.fiber, fcont);
|
||||
|
||||
if (!fcont->alive) {
|
||||
rb_raise(rb_eRuntimeError, "continuation called dead fiber");
|
||||
}
|
||||
}
|
||||
|
||||
cont->value = make_passing_arg(argc, argv);
|
||||
|
||||
|
|
Loading…
Reference in a new issue