зеркало из https://github.com/github/ruby.git
* vm_insnhelper.c (vm_yield_setup_args): should not drop arguments
corresponding to default paramters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
e8a71e64a1
Коммит
5c0515f2e2
|
@ -1,3 +1,8 @@
|
|||
Wed Oct 22 16:27:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* vm_insnhelper.c (vm_yield_setup_args): should not drop arguments
|
||||
corresponding to default paramters.
|
||||
|
||||
Wed Oct 22 14:59:30 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* parse.y (f_larglist): should not allow semicolon separated local
|
||||
|
|
|
@ -728,12 +728,13 @@ vm_yield_setup_args(rb_thread_t * const th, const rb_iseq_t *iseq,
|
|||
}
|
||||
|
||||
if (iseq->arg_rest == -1) {
|
||||
if (m < argc) {
|
||||
const int arg_size = iseq->arg_size;
|
||||
if (arg_size < argc) {
|
||||
/*
|
||||
* yield 1, 2
|
||||
* => {|a|} # truncate
|
||||
*/
|
||||
th->mark_stack_len = argc = m;
|
||||
th->mark_stack_len = argc = arg_size;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче