mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* vm_insnhelper.c (vm_yield_setup_args): object with to_ary should
behave like array. a patch from Yusuke Endoh <mame at tsg.ne.jp> in [ruby-dev:35988]. [ruby-dev:35977] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a7fa5122d7
commit
f7f0784270
2 changed files with 8 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Thu Aug 28 20:22:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* vm_insnhelper.c (vm_yield_setup_args): object with to_ary should
|
||||||
|
behave like array. a patch from Yusuke Endoh <mame at tsg.ne.jp>
|
||||||
|
in [ruby-dev:35988]. [ruby-dev:35977]
|
||||||
|
|
||||||
Thu Aug 28 19:04:50 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
Thu Aug 28 19:04:50 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* bootstraptest/test_io.rb: no need to create real file.
|
* bootstraptest/test_io.rb: no need to create real file.
|
||||||
|
|
|
@ -704,6 +704,7 @@ vm_yield_setup_args(rb_thread_t * const th, const rb_iseq_t *iseq,
|
||||||
int i;
|
int i;
|
||||||
int argc = orig_argc;
|
int argc = orig_argc;
|
||||||
const int m = iseq->argc;
|
const int m = iseq->argc;
|
||||||
|
VALUE ary;
|
||||||
|
|
||||||
th->mark_stack_len = argc;
|
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) &&
|
if (!(iseq->arg_simple & 0x02) &&
|
||||||
(m + iseq->arg_post_len) > 0 &&
|
(m + iseq->arg_post_len) > 0 &&
|
||||||
argc == 1 && TYPE(argv[0]) == T_ARRAY) {
|
argc == 1 && !NIL_P(ary = rb_check_array_type(argv[0]))) {
|
||||||
VALUE ary = argv[0];
|
|
||||||
th->mark_stack_len = argc = RARRAY_LEN(ary);
|
th->mark_stack_len = argc = RARRAY_LEN(ary);
|
||||||
|
|
||||||
CHECK_STACK_OVERFLOW(th->cfp, argc);
|
CHECK_STACK_OVERFLOW(th->cfp, argc);
|
||||||
|
|
Loading…
Add table
Reference in a new issue