From 100d0a568eeac44c8844a3a8707a1faa460f5106 Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 29 Aug 2008 08:24:51 +0000 Subject: [PATCH] * vm_insnhelper.c (vm_call_method): copy arguments to allocated memory from machine stack. [ruby-dev:36028] * KNOWNBUGS.rb, bootstraptest/test_method.rb: move fixed test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ KNOWNBUGS.rb | 11 ----------- bootstraptest/test_method.rb | 11 +++++++++++ vm_insnhelper.c | 5 +++-- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8dfa972609..9134621c74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Fri Aug 29 16:48:34 2008 Koichi Sasada + + * vm_insnhelper.c (vm_call_method): copy arguments to allocated + memory from machine stack. [ruby-dev:36028] + + * KNOWNBUGS.rb, bootstraptest/test_method.rb: move fixed test. + Fri Aug 29 12:19:12 2008 Nobuyoshi Nakada * ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): fix for diff --git a/KNOWNBUGS.rb b/KNOWNBUGS.rb index 3db710a73a..39dc6a9b8b 100644 --- a/KNOWNBUGS.rb +++ b/KNOWNBUGS.rb @@ -2,14 +2,3 @@ # This test file concludes tests which point out known bugs. # So all tests will cause failure. # - -assert_equal 'ok', %q{ - class Foo - define_method(:foo) do |&b| - b.call - end - end - Foo.new.foo do - break :ok - end -}, '[ruby-dev:36028]' diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb index 5bc0f8ccec..63c6ad2db1 100644 --- a/bootstraptest/test_method.rb +++ b/bootstraptest/test_method.rb @@ -1058,3 +1058,14 @@ assert_equal '[false, false, false, false, true, true]', %q{ D.new.bar{} [C.new.foo, C.new.foo{}, D.new.m1, D.new.m1{}, D.new.m2, D.new.m2{}] }, '[ruby-core:14813]' + +assert_equal 'ok', %q{ + class Foo + define_method(:foo) do |&b| + b.call + end + end + Foo.new.foo do + break :ok + end +}, '[ruby-dev:36028]' diff --git a/vm_insnhelper.c b/vm_insnhelper.c index f40d6a2414..abf74d7491 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -518,9 +518,10 @@ vm_call_method(rb_thread_t * const th, rb_control_frame_t * const cfp, break; } case NODE_BMETHOD:{ - VALUE *argv = cfp->sp - num; - val = vm_call_bmethod(th, id, node->nd_cval, recv, klass, num, argv, blockptr); + VALUE *argv = ALLOCA_N(VALUE, num); + MEMCPY(argv, cfp->sp - num, VALUE, num); cfp->sp += - num - 1; + val = vm_call_bmethod(th, id, node->nd_cval, recv, klass, num, argv, blockptr); break; } case NODE_ZSUPER:{