From f7f0784270ce51fac9c21b58668b3e455d2ae60e Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 28 Aug 2008 11:29:57 +0000 Subject: * vm_insnhelper.c (vm_yield_setup_args): object with to_ary should behave like array. a patch from Yusuke Endoh in [ruby-dev:35988]. [ruby-dev:35977] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ vm_insnhelper.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6033fe9e48..1c35787ac9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Aug 28 20:22:49 2008 Yukihiro Matsumoto + + * vm_insnhelper.c (vm_yield_setup_args): object with to_ary should + behave like array. a patch from Yusuke Endoh + in [ruby-dev:35988]. [ruby-dev:35977] + Thu Aug 28 19:04:50 2008 NAKAMURA Usaku * bootstraptest/test_io.rb: no need to create real file. diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 07fe32d2a2..f40d6a2414 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -704,6 +704,7 @@ vm_yield_setup_args(rb_thread_t * const th, const rb_iseq_t *iseq, int i; int argc = orig_argc; const int m = iseq->argc; + VALUE ary; th->mark_stack_len = argc; @@ -714,8 +715,7 @@ vm_yield_setup_args(rb_thread_t * const th, const rb_iseq_t *iseq, */ if (!(iseq->arg_simple & 0x02) && (m + iseq->arg_post_len) > 0 && - argc == 1 && TYPE(argv[0]) == T_ARRAY) { - VALUE ary = argv[0]; + argc == 1 && !NIL_P(ary = rb_check_array_type(argv[0]))) { th->mark_stack_len = argc = RARRAY_LEN(ary); CHECK_STACK_OVERFLOW(th->cfp, argc); -- cgit v1.2.3