mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* vm_eval.c (rb_iterate): remove SEGV (use the original patch).
[ruby-dev:39874] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ff26cb8252
commit
c8b20d0877
2 changed files with 18 additions and 11 deletions
|
@ -1,3 +1,8 @@
|
|||
Sun Dec 20 23:18:23 2009 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* vm_eval.c (rb_iterate): remove SEGV (use the original patch).
|
||||
[ruby-dev:39874]
|
||||
|
||||
Sun Dec 20 21:26:05 2009 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* vm_eval.c (rb_iterate): pass current block when the argument bl_proc
|
||||
|
|
24
vm_eval.c
24
vm_eval.c
|
@ -820,24 +820,26 @@ rb_iterate(VALUE (* it_proc) (VALUE), VALUE data1,
|
|||
{
|
||||
int state;
|
||||
volatile VALUE retval = Qnil;
|
||||
NODE *node = NEW_IFUNC(bl_proc, data2);
|
||||
rb_thread_t *th = GET_THREAD();
|
||||
rb_control_frame_t *volatile cfp = th->cfp;
|
||||
rb_block_t *blockptr;
|
||||
|
||||
if (bl_proc) {
|
||||
blockptr = RUBY_VM_GET_BLOCK_PTR_IN_CFP(th->cfp);
|
||||
blockptr->iseq = (void *)NEW_IFUNC(bl_proc, data2);
|
||||
blockptr->proc = 0;
|
||||
}
|
||||
else {
|
||||
blockptr = GC_GUARDED_PTR_REF(th->cfp->lfp[0]);
|
||||
}
|
||||
*(rb_block_t *volatile *)&blockptr = blockptr;
|
||||
TH_PUSH_TAG(th);
|
||||
state = TH_EXEC_TAG();
|
||||
if (state == 0) {
|
||||
iter_retry:
|
||||
th->passed_block = *(rb_block_t *volatile *)&blockptr;
|
||||
{
|
||||
rb_block_t *blockptr;
|
||||
if (bl_proc) {
|
||||
blockptr = RUBY_VM_GET_BLOCK_PTR_IN_CFP(th->cfp);
|
||||
blockptr->iseq = (void *)NEW_IFUNC(bl_proc, data2);
|
||||
blockptr->proc = 0;
|
||||
}
|
||||
else {
|
||||
blockptr = GC_GUARDED_PTR_REF(th->cfp->lfp[0]);
|
||||
}
|
||||
th->passed_block = blockptr;
|
||||
}
|
||||
retval = (*it_proc) (data1);
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in a new issue