diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-20 14:20:46 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-20 14:20:46 +0000 |
commit | c8b20d0877a1c47c726f6128d98557ee6da09060 (patch) | |
tree | 8c3d17373c3c1ebc60a7555f2f2743f2704f9fc8 /vm_eval.c | |
parent | ff26cb82522398e09f13a6a1397c73d7d73f83d2 (diff) | |
download | bundler-c8b20d0877a1c47c726f6128d98557ee6da09060.tar.gz |
* 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
Diffstat (limited to 'vm_eval.c')
-rw-r--r-- | vm_eval.c | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -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 { |