* insnhelper.ci (vm_yield_with_cfunc): call cfunc with

(argv[0], data, argc, argv) to pass all arguments.

* eval.c (loop_i): adapted to new calling convention.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-12-19 06:37:41 +00:00
Родитель 1de2b12597
Коммит f00338f430
3 изменённых файлов: 14 добавлений и 17 удалений

Просмотреть файл

@ -1,3 +1,10 @@
Wed Dec 19 15:37:06 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* insnhelper.ci (vm_yield_with_cfunc): call cfunc with
(argv[0], data, argc, argv) to pass all arguments.
* eval.c (loop_i): adapted to new calling convention.
Wed Dec 19 15:13:20 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_justify): should propagate encoding from pad

Просмотреть файл

@ -225,14 +225,9 @@ enumerator_allocate(VALUE klass)
}
static VALUE
enumerator_each_i(VALUE v, VALUE enum_obj, VALUE argc)
enumerator_each_i(VALUE v, VALUE enum_obj, int argc, VALUE *argv)
{
if (argc == 1) {
return rb_yield(v);
}
else {
return rb_yield_values2(argc, RARRAY_PTR(v));
}
return rb_yield_values2(argc, argv);
}
static VALUE

Просмотреть файл

@ -650,23 +650,18 @@ vm_yield_with_cfunc(rb_thread_t *th, rb_block_t *block,
if (lambda) {
arg = rb_ary_new4(argc, argv);
}
else if (argc == 0) {
arg = Qnil;
}
else {
if (argc == 1) {
arg = *argv;
}
else if (argc > 1) {
arg = rb_ary_new4(argc, argv);
}
else {
arg = rb_ary_new();
}
arg = argv[0];
}
vm_push_frame(th, 0, FRAME_MAGIC_IFUNC,
self, (VALUE)block->dfp,
0, th->cfp->sp, block->lfp, 1);
val = (*ifunc->nd_cfnc) (arg, ifunc->nd_tval, (VALUE) argc);
val = (*ifunc->nd_cfnc) (arg, ifunc->nd_tval, argc, argv);
th->cfp++;
return val;