Issue #5832 has been reported by Kazuki Tsujimoto.

----------------------------------------
Bug #5832: ????潟???????????????羝??????茵?????????
https://bugs.ruby-lang.org/issues/5832

Author: Kazuki Tsujimoto
Status: Assigned
Priority: Normal
Assignee: Koichi Sasada
Category: YARV
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-01-01 trunk 34167) [x86_64-linux]


=begin
莨紙??с?????

invoke_block_from_c???若?喝?冴????????羝?????????????????????
VM loop??????膓???????若?喝?冴??????????ャ??<?純?????????羝<???????????障????宴?若?鴻??????????障?????

 $ ./ruby -ve "
 require 'pp'
 require 'pathname'

 class <<File
   alias realpath_orig realpath

   def realpath(*args)
     yield if block_given?
     realpath_orig(*args)
   end
 end

 pathname = Pathname.new('.')
 Class.new do
   define_method(:foo) {
     pathname.realpath
   }
 end.new.foo { pp caller }
 "
 ruby 2.0.0dev (2012-01-01 trunk 34167) [x86_64-linux]
 ["-e:9:in `realpath'",
  "-e:17:in `realpath'",
  "-e:17:in `block (2 levels) in <main>'",
  "-e:19:in `<main>'"]

blockptr???????若????????障?????????????????с??
passed_block??篁??ャ?????茵?????膣???????ゃ????????障?c?????????????障?????

 diff --git a/vm.c b/vm.c
 index 2f38eee..3ea190f 100644
 --- a/vm.c
 +++ b/vm.c
 @@ -597,7 +597,6 @@ invoke_block_from_c(rb_thread_t *th, const rb_block_t *block,
  			     iseq->local_size - arg_size);
  	ncfp->me = th->passed_me;
  	th->passed_me = 0;
 -	th->passed_block = blockptr;
  
  	if (cref) {
  	    th->cfp->dfp[-1] = (VALUE)cref;
=end



-- 
http://redmine.ruby-lang.org