* vm_eval.c (vm_call_super): fixed typo, and get rid of too large

alloca.  [ruby-core:17922]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-08-04 08:37:48 +00:00
Родитель 8d0fdce468
Коммит bcf9324e68
2 изменённых файлов: 16 добавлений и 2 удалений

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

@ -1,3 +1,8 @@
Mon Aug 4 17:37:46 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* vm_eval.c (vm_call_super): fixed typo, and get rid of too large
alloca. [ruby-core:17922]
Mon Aug 4 16:48:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (deferred_nodes, compstmt, arg, fixup_nodes, range_op): fix

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

@ -148,12 +148,21 @@ vm_call_super(rb_thread_t * const th, const int argc, const VALUE * const argv)
body = body->nd_body;
}
else {
VALUE *argv_m = ALLOCA_N(VALUE, argc+1);
VALUE *argv_m, result, argv_ary = 0;
if (argc < 0x100) {
argv_m = ALLOCA_N(VALUE, argc+1);
}
else {
argv_ary = rb_ary_tmp_new(argc+1);
argv_m = RARRAY_PTR(argv_ary);
}
MEMCPY(argv_m + 1, argv, VALUE, argc);
argv_m[0] = ID2SYM(id);
th->method_missing_reason = 0;
th->passed_block = 0;
return rb_funcall2(recv, idMethodMissing, argc + 1, argv);
result = rb_funcall2(recv, idMethodMissing, argc + 1, argv_m);
if (argv_ary) rb_ary_clear(argv_ary);
return result;
}
return vm_call0(th, klass, recv, id, id, argc, argv, body, CALL_SUPER);