1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* vm_insnhelper.c (vm_callee_setup_arg_complex): uses cfp from

blockptr instead of the current cfp.  [ruby-core:20544]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-12-15 07:26:48 +00:00
parent 3a5c0bbcb5
commit 8c8d666467
3 changed files with 25 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Mon Dec 15 16:26:46 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* vm_insnhelper.c (vm_callee_setup_arg_complex): uses cfp from
blockptr instead of the current cfp. [ruby-core:20544]
Mon Dec 15 14:56:59 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* test/ruby/test_metaclass.rb: new test case for metaclass hierarchy.

View file

@ -486,6 +486,24 @@ assert_equal 'ok', %q{
C.new.foo("ng") {"ok"}
}, '[ruby-talk:266422]'
assert_equal 'ok', %q{
class C
define_method(:xyz) do |o, k, &block|
block.call(o, k)
end
end
C.new.xyz("o","k") {|o, k| o+k}
}, '[ruby-core:20544]'
assert_equal 'ok', %q{
class C
define_method(:xyz) do |*args, &block|
block.call(*args)
end
end
C.new.xyz("o","k") {|*args| args.join("")}
}, '[ruby-core:20544]'
assert_equal 'ok', %q{
STDERR.reopen(STDOUT)
class C

View file

@ -186,7 +186,8 @@ vm_callee_setup_arg_complex(rb_thread_t *th, const rb_iseq_t * iseq,
if (blockptr->proc == 0) {
rb_proc_t *proc;
blockval = vm_make_proc(th, th->cfp, blockptr, rb_cProc);
blockval = vm_make_proc(th, RUBY_VM_GET_CFP_FROM_BLOCK_PTR(blockptr),
blockptr, rb_cProc);
GetProcPtr(blockval, proc);
*block = &proc->block;